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

📄 plan_bad.t

📁 source of perl for linux application,
💻 T
字号:
#!/usr/bin/perl -wBEGIN {    if( $ENV{PERL_CORE} ) {        chdir 't';        @INC = '../lib';    }}use Test::More tests => 10;use Test::Builder;my $tb = Test::Builder->create;$tb->level(0);ok !eval { $tb->plan( tests => 'no_plan' ); };is $@, sprintf "Number of tests must be a positive integer.  You gave it 'no_plan' at %s line %d.\n", $0, __LINE__ - 1;my $foo = [];my @foo = ($foo, 2, 3);ok !eval { $tb->plan( tests => @foo ) };is $@, sprintf "Number of tests must be a positive integer.  You gave it '$foo' at %s line %d.\n", $0, __LINE__ - 1;#line 25ok !eval { $tb->plan( tests => -1 ) };is $@, "Number of tests must be a positive integer.  You gave it '-1' at $0 line 25.\n";#line 29ok !eval { $tb->plan( tests => '' ) };is $@, "You said to run 0 tests at $0 line 29.\n";#line 33ok !eval { $tb->plan( 'wibble' ) };is $@, "plan() doesn't understand wibble at $0 line 33.\n";

⌨️ 快捷键说明

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