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/erroneous_usage.t
use strict; use warnings; use Test::More tests => 8; use Try::Tiny; sub _eval { local $@; local $Test::Builder::Level = $Test::Builder::Level + 2; return ( scalar(eval { $_[0]->(); 1 }), $@ ); } sub throws_ok (&$$) { my ( $code, $regex, $desc ) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; my ( $ok, $error ) = _eval($code); if ( $ok ) { fail($desc); } else { like($error || '', $regex, $desc ); } } throws_ok { try { 1 }; catch { 2 }; } qr/\QUseless bare catch()/, 'Bare catch() detected'; throws_ok { try { 1 }; finally { 2 }; } qr/\QUseless bare finally()/, 'Bare finally() detected'; throws_ok { try { 1 }; catch { 2 } finally { 2 }; } qr/\QUseless bare catch()/, 'Bare catch()/finally() detected'; throws_ok { try { 1 }; finally { 2 } catch { 2 }; } qr/\QUseless bare finally()/, 'Bare finally()/catch() detected'; throws_ok { try { 1 } catch { 2 } catch { 3 } finally { 4 } finally { 5 } } qr/\QA try() may not be followed by multiple catch() blocks/, 'Multi-catch detected'; throws_ok { try { 1 } catch { 2 } do { 2 } } qr/\Qtry() encountered an unexpected argument (2) - perhaps a missing semi-colon before or at/, 'Unterminated try detected'; sub foo { try { 0 }; catch { 2 } } throws_ok { if (foo()) { # ... } } qr/\QUseless bare catch/, 'Bare catch at the end of a function call'; sub bar { try { 0 }; finally { 2 } } throws_ok { if (bar()) { # ... } } qr/\QUseless bare finally/, 'Bare finally at the end of a function call';
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply