1Test::Unit::Assertion::UEsxecrepCtoinotnr(i3b)uted PerlTDeosctu:m:eUnntiatt:i:oAnssertion::Exception(3)
2
3
4
6 Test::Unit::Assertion::Exception - A assertion for raised exceptions
7
9 require Test::Unit::Assertion::Exception;
10
11 my $assert_raised =
12 Test::Unit::Assertion::Exception->new('MyException');
13
14 # This should succeed
15 $assert_eq->do_assertion(sub { MyException->throw() });
16
17 # This should fail
18 $assert_eq->do_assertion(sub { });
19
21 Although the SYNOPSIS shows how you'd use
22 Test::Unit::Assertion::Exception directly, it is more sensibly used
23 indirectly via Test::Unit::Test::assert_raises(), which instantiates a
24 "Test::Unit::Assertion::Exception".
25
27 Copyright (c) 2001 Piers Cawley <pdcawley@iterative-software.com>.
28
29 All rights reserved. This program is free software; you can
30 redistribute it and/or modify it under the same terms as Perl itself.
31
33 • Test::Unit::TestCase
34
35 • Test::Unit::Assertion
36
37
38
39perl v5.36.0 2023-01-20Test::Unit::Assertion::Exception(3)