ACIL FM
Dark
Refresh
Current DIR:
/usr/share/doc/perl-Try-Tiny/t
/
usr
share
doc
perl-Try-Tiny
t
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
lib
-
chmod
Open
Rename
Delete
00-report-prereqs.dd
10.07 MB
chmod
View
DL
Edit
Rename
Delete
00-report-prereqs.t
5.83 MB
chmod
View
DL
Edit
Rename
Delete
basic.t
3 MB
chmod
View
DL
Edit
Rename
Delete
context.t
1.17 MB
chmod
View
DL
Edit
Rename
Delete
erroneous_usage.t
1.5 MB
chmod
View
DL
Edit
Rename
Delete
finally.t
2.5 MB
chmod
View
DL
Edit
Rename
Delete
given_when.t
694 B
chmod
View
DL
Edit
Rename
Delete
global_destruction_forked.t
953 B
chmod
View
DL
Edit
Rename
Delete
global_destruction_load.t
550 B
chmod
View
DL
Edit
Rename
Delete
named.t
685 B
chmod
View
DL
Edit
Rename
Delete
when.t
669 B
chmod
View
DL
Edit
Rename
Delete
zzz-check-breaks.t
1.06 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /usr/share/doc/perl-Try-Tiny/t/context.t
use strict; use warnings; use Test::More; use Try::Tiny; plan tests => (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 ; 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'; }; }
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply