Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
perl5 /
Test /
Unit /
Assertion /
[ HOME SHELL ]
Name
Size
Permission
Action
Boolean.pm
1.54
KB
-rw-r--r--
CodeRef.pm
3.11
KB
-rw-r--r--
Exception.pm
1.82
KB
-rw-r--r--
Regexp.pm
2.21
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : Exception.pm
package Test::Unit::Assertion::Exception; use strict; use base qw/Test::Unit::Assertion/; use Carp; use Error qw/:try/; use Test::Unit::Debug qw(debug); my $deparser; sub new { my $class = shift; my $exception_class = shift; croak "$class\::new needs an exception class" unless $exception_class; bless \$exception_class => $class; } sub do_assertion { my $self = shift; my $coderef = shift; my $exception_class = $$self; my $exception; try { &$coderef(); } catch $exception_class with { $exception = shift; }; if (! $exception || ! $exception->isa($$self)) { $self->fail(@_ ? $_[0] : "No $exception_class was raised"); } return $exception; # so that it can be stored in the test for the # user to get at. } sub to_string { my $self = shift; return "$$self exception assertion"; } 1; __END__ =head1 NAME Test::Unit::Assertion::Exception - A assertion for raised exceptions =head1 SYNOPSIS require Test::Unit::Assertion::Exception; my $assert_raised = Test::Unit::Assertion::Exception->new('MyException'); # This should succeed $assert_eq->do_assertion(sub { MyException->throw() }); # This should fail $assert_eq->do_assertion(sub { }); =head1 DESCRIPTION Although the SYNOPSIS shows how you'd use Test::Unit::Assertion::Exception directly, it is more sensibly used indirectly via C<Test::Unit::Test::assert_raises()>, which instantiates a C<Test::Unit::Assertion::Exception>. =head1 AUTHOR Copyright (c) 2001 Piers Cawley E<lt>pdcawley@iterative-software.comE<gt>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO =over 4 =item * L<Test::Unit::TestCase> =item * L<Test::Unit::Assertion> =back
Close