⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 try.t

📁 source of perl for linux application,
💻 T
字号:
#!perl -wBEGIN {    if( $ENV{PERL_CORE} ) {        chdir 't';        @INC = ('../lib', 'lib');    }    else {        unshift @INC, 't/lib';    }}use strict;use Test::More 'no_plan';require Test::Builder;my $tb = Test::Builder->new;local $SIG{__DIE__} = sub { fail("DIE handler called: @_") };# These should not change;local $@ = 42;local $! = 23;is $tb->_try(sub { 2 }), 2;is $tb->_try(sub { return '' }), '';is $tb->_try(sub { die; }), undef;is_deeply [$tb->_try(sub { die "Foo\n" }, undef)],          [undef, "Foo\n"];is $@, 42;cmp_ok $!, '==', 23;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -