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

📄 todo.t

📁 source of perl for linux application,
💻 T
字号:
# -*-perl-*-use strict;use Test qw(:DEFAULT $TESTOUT $TESTERR $ntest);### This test is crafted in such a way as to prevent Test::Harness from### seeing the todo tests, otherwise you get people sending in bug reports### about Test.pm having "UNEXPECTEDLY SUCCEEDED" tests.open F, ">todo";$TESTOUT = *F{IO};$TESTERR = *F{IO};my $tests = 5; plan tests => $tests, todo => [2..$tests]; # tests to go to the output fileok(1);ok(1);ok(0,1);ok(0,1,"need more tuits");ok(1,1);close F;$TESTOUT = *STDOUT{IO};$TESTERR = *STDERR{IO};$ntest = 1;open F, "todo";my $out = join '', <F>;close F;unlink "todo";my $expect = <<"EXPECT";1..5 todo 2 3 4 5;ok 1ok 2 # ($0 at line 18 TODO?!)not ok 3# Test 3 got: '0' ($0 at line 19 *TODO*)#   Expected: '1'not ok 4# Test 4 got: '0' ($0 at line 20 *TODO*)#   Expected: '1' (need more tuits)ok 5 # ($0 at line 21 TODO?!)EXPECTsub commentless {  my $in = $_[0];  $in =~ s/^#[^\n]*\n//mg;  $in =~ s/\n#[^\n]*$//mg;  return $in;}print "1..1\n";ok( commentless($out), commentless($expect) );

⌨️ 快捷键说明

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