![]() |
![]()
| ![]() |
![]()
NAMETest2::Tools::Exception - Test2 based tools for checking exceptions DESCRIPTIONThis is the Test2 implementation of code used to test exceptions. This is similar to Test::Fatal, but it intentionally does much less. SYNOPSISuse Test2::Tools::Exception qw/dies lives/; like( dies { die 'xxx' }, qr/xxx/, "Got exception" ); ok(lives { ... }, "did not die") or note($@); EXPORTSAll subs are exported by default.
DIFFERENCES FROM TEST::FATALTest::Fatal sets $Test::Builder::Level such that failing tests inside the exception block will report to the line where exception() is called. I disagree with this, and think the actual line of the failing test is more important. Ultimately, though Test::Fatal cannot be changed, people probably already depend on that behavior. SOURCEThe source code repository for Test2-Suite can be found at https://github.com/Test-More/Test2-Suite/. MAINTAINERSAUTHORSCOPYRIGHTCopyright 2018 Chad Granum <exodist@cpan.org>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
|