亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? simple.pm

?? cgi編程更新庫
?? PM
字號:
package Test::Simple;use 5.004;use strict 'vars';use Test::Utils;use vars qw($VERSION);$VERSION = '0.18';my(@Test_Results) = ();my($Num_Tests, $Planned_Tests, $Test_Died) = (0,0,0);my($Have_Plan) = 0;my $IsVMS = $^O eq 'VMS';# I'd like to have Test::Simple interfere with the program being# tested as little as possible.  This includes using Exporter or# anything else (including strict).sub import {    # preserve caller()    if( @_ > 1 ) {        if( $_[1] eq 'no_plan' ) {            goto &no_plan;        }        else {            goto &plan        }    }}sub plan {    my($class, %config) = @_;    if( !exists $config{tests} ) {        die "You have to tell $class how many tests you plan to run.\n".            "  use $class tests => 42;  for example.\n";    }    elsif( !defined $config{tests} ) {        die "Got an undefined number of tests.  Looks like you tried to tell ".            "$class how many tests you plan to run but made a mistake.\n";    }    elsif( !$config{tests} ) {        die "You told $class you plan to run 0 tests!  You've got to run ".            "something.\n";    }    else {        $Planned_Tests = $config{tests};    }    $Have_Plan = 1;    my_print *TESTOUT, "1..$Planned_Tests\n";    no strict 'refs';    my($caller) = caller;    *{$caller.'::ok'} = \&ok;    }sub no_plan {    $Have_Plan = 1;    my($caller) = caller;    no strict 'refs';    *{$caller.'::ok'} = \&ok;}$| = 1;open(*TESTOUT, ">&STDOUT") or _whoa(1, "Can't dup STDOUT!");open(*TESTERR, ">&STDERR") or _whoa(1, "Can't dup STDERR!");{    my $orig_fh = select TESTOUT;    $| = 1;    select TESTERR;    $| = 1;    select $orig_fh;}=head1 NAMETest::Simple - Basic utilities for writing tests.=head1 SYNOPSIS  use Test::Simple tests => 1;  ok( $foo eq $bar, 'foo is bar' );=head1 DESCRIPTION** If you are unfamiliar with testing B<read Test::Tutorial> first! **This is an extremely simple, extremely basic module for writing testssuitable for CPAN modules and other pursuits.  If you wish to do morecomplicated testing, use the Test::More module (a drop-in replacementfor this one).The basic unit of Perl testing is the ok.  For each thing you want totest your program will print out an "ok" or "not ok" to indicate passor fail.  You do this with the ok() function (see below).The only other constraint is you must predeclare how many tests youplan to run.  This is in case something goes horribly wrong during thetest and your test program aborts, or skips a test or whatever.  Youdo this like so:    use Test::Simple tests => 23;You must have a plan.=over 4=item B<ok>  ok( $foo eq $bar, $name );  ok( $foo eq $bar );ok() is given an expression (in this case C<$foo eq $bar>).  If itstrue, the test passed.  If its false, it didn't.  That's about it.ok() prints out either "ok" or "not ok" along with a test number (itkeeps track of that for you).  # This produces "ok 1 - Hell not yet frozen over" (or not ok)  ok( get_temperature($hell) > 0, 'Hell not yet frozen over' );If you provide a $name, that will be printed along with the "ok/notok" to make it easier to find your test when if fails (just search forthe name).  It also makes it easier for the next guy to understandwhat your test is for.  Its highly recommended you use test names.All tests are run in scalar context.  So this:    ok( @stuff, 'I have some stuff' );will do what you mean (fail if stuff is empty)=cutsub ok ($;$) {    my($test, $name) = @_;    unless( $Have_Plan ) {        die "You tried to use ok() without a plan!  Gotta have a plan.\n".            "  use Test::Simple tests => 23;   for example.\n";    }    $Num_Tests++;    my_print *TESTERR, <<ERR if defined $name and $name =~ /^[\d\s]+$/;You named your test '$name'.  You shouldn't use numbers for your test names.Very confusing.ERR    my($pack, $file, $line) = caller;    if( $pack eq 'Test::More' ) {   # special case for Test::More's calls        ($pack, $file, $line) = caller(1);    }    my($is_todo)  = ${$pack.'::TODO'} ? 1 : 0;    # We must print this all in one shot or else it will break on VMS    my $msg;    unless( $test ) {        $msg .= "not ";        $Test_Results[$Num_Tests-1] = $is_todo ? 1 : 0;    }    else {        $Test_Results[$Num_Tests-1] = 1;    }    $msg   .= "ok $Num_Tests";    if( defined $name ) {        $name =~ s|#|\\#|g;     # # in a name can confuse Test::Harness.        $msg   .= " - $name";    }    if( $is_todo ) {        my $what_todo = ${$pack.'::TODO'};        $msg   .= " # TODO $what_todo";    }    $msg   .= "\n";    my_print *TESTOUT, $msg;    #'#    unless( $test or $is_todo ) {        my_print *TESTERR, "#     Failed test ($file at line $line)\n";    }    return $test ? 1 : 0;}sub _skipped {    my($why) = shift;    unless( $Have_Plan ) {        die "You tried to use ok() without a plan!  Gotta have a plan.\n".            "  use Test::Simple tests => 23;   for example.\n";    }    $Num_Tests++;    # XXX Set this to "Skip" instead?    $Test_Results[$Num_Tests-1] = 1;    # We must print this all in one shot or else it will break on VMS    my $msg;    $msg   .= "ok $Num_Tests # skip $why\n";    my_print *TESTOUT, $msg;    return 1;}=backTest::Simple will start by printing number of tests run in the form"1..M" (so "1..5" means you're going to run 5 tests).  This strangeformat lets Test::Harness know how many tests you plan on running incase something goes horribly wrong.If all your tests passed, Test::Simple will exit with zero (which isnormal).  If anything failed it will exit with how many failed.  Ifyou run less (or more) tests than you planned, the missing (or extras)will be considered failures.  If no tests were ever run Test::Simplewill throw a warning and exit with 255.  If the test died, even afterhaving successfully completed all its tests, it will still beconsidered a failure and will exit with 255.So the exit codes are...    0                   all tests successful    255                 test died    any other number    how many failed (including missing or extras)If you fail more than 254 tests, it will be reported as 254.=begin _private=over 4=item B<_sanity_check>  _sanity_check();Runs a bunch of end of test sanity checks to make sure reality camethrough ok.  If anything is wrong it will die with a fairly friendlyerror message.=cut#'#sub _sanity_check {    _whoa($Num_Tests < 0,  'Says here you ran a negative number of tests!');    _whoa(!$Have_Plan and $Num_Tests,           'Somehow your tests ran without a plan!');    _whoa($Num_Tests != @Test_Results,          'Somehow you got a different number of results than tests ran!');}=item B<_whoa>  _whoa($check, $description);A sanity check, similar to assert().  If the $check is true, somethinghas gone horribly wrong.  It will die with the given $description anda note to contact the author.=cutsub _whoa {    my($check, $desc) = @_;    if( $check ) {        die <<WHOA;WHOA!  $descThis should never happen!  Please contact the author immediately!WHOA    }}=item B<_my_exit>  _my_exit($exit_num);Perl seems to have some trouble with exiting inside an END block.  5.005_03and 5.6.1 both seem to do odd things.  Instead, this function edits $?directly.  It should ONLY be called from inside an END block.  Itdoesn't actually exit, that's your job.=cutsub _my_exit {    $? = $_[0];    return 1;}=back=end _private=cut$SIG{__DIE__} = sub {    # We don't want to muck with death in an eval, but $^S isn't    # totally reliable.  5.005_03 and 5.6.1 both do the wrong thing    # with it.  Instead, we use caller.  This also means it runs under    # 5.004!    my $in_eval = 0;    for( my $stack = 1;  my $sub = (caller($stack))[3];  $stack++ ) {        $in_eval = 1 if $sub =~ /^\(eval\)/;    }    $Test_Died = 1 unless $in_eval;};END {    _sanity_check();    # Bailout if import() was never called.  This is so    # "require Test::Simple" doesn't puke.    do{ _my_exit(0) && return } if !$Have_Plan and !$Num_Tests;    # Figure out if we passed or failed and print helpful messages.    if( $Num_Tests ) {        # The plan?  We have no plan.        unless( $Planned_Tests ) {            my_print *TESTOUT, "1..$Num_Tests\n";            $Planned_Tests = $Num_Tests;        }        my $num_failed = grep !$_, @Test_Results[0..$Planned_Tests-1];        $num_failed += abs($Planned_Tests - @Test_Results);        if( $Num_Tests < $Planned_Tests ) {            my_print *TESTERR, <<"FAIL";# Looks like you planned $Planned_Tests tests but only ran $Num_Tests.FAIL        }        elsif( $Num_Tests > $Planned_Tests ) {            my $num_extra = $Num_Tests - $Planned_Tests;            my_print *TESTERR, <<"FAIL";# Looks like you planned $Planned_Tests tests but ran $num_extra extra.FAIL        }        elsif ( $num_failed ) {            my_print *TESTERR, <<"FAIL";# Looks like you failed $num_failed tests of $Planned_Tests.FAIL        }        if( $Test_Died ) {            my_print *TESTERR, <<"FAIL";# Looks like your test died just after $Num_Tests.FAIL            _my_exit( 255 ) && return;        }        _my_exit( $num_failed <= 254 ? $num_failed : 254  ) && return;    }    elsif ( $Test::Simple::Skip_All ) {        _my_exit( 0 ) && return;    }    else {        my_print *TESTERR, "# No tests run!\n";        _my_exit( 255 ) && return;    }}=podThis module is by no means trying to be a complete testing system.Its just to get you started.  Once you're off the ground itsrecommended you look at L<Test::More>.=head1 EXAMPLEHere's an example of a simple .t file for the fictional Film module.    use Test::Simple tests => 5;    use Film;  # What you're testing.    my $btaste = Film->new({ Title    => 'Bad Taste',                             Director => 'Peter Jackson',                             Rating   => 'R',                             NumExplodingSheep => 1                           });    ok( defined($btaste) and ref $btaste eq 'Film',     'new() works' );    ok( $btaste->Title      eq 'Bad Taste',     'Title() get'    );    ok( $btaste->Director   eq 'Peter Jackson', 'Director() get' );    ok( $btaste->Rating     eq 'R',             'Rating() get'   );    ok( $btaste->NumExplodingSheep == 1,        'NumExplodingSheep() get' );It will produce output like this:    1..5    ok 1 - new() works    ok 2 - Title() get    ok 3 - Director() get    not ok 4 - Rating() get    #    Failed test (t/film.t at line 14)    ok 5 - NumExplodingSheep() get    # Looks like you failed 1 tests of 5Indicating the Film::Rating() method is broken.=head1 CAVEATSTest::Simple will only report a maximum of 254 failures in its exitcode.  If this is a problem, you probably have a huge test script.Split it into multiple files.  (Otherwise blame the Unix folks forusing an unsigned short integer as the exit status).Because VMS's exit codes are much, much different than the rest of theuniverse, and perl does horrible mangling to them that gets in my way,it works like this on VMS.    0     SS$_NORMAL        all tests successful    4     SS$_ABORT         something went wrongUnfortunately, I can't differentiate any further.=head1 NOTESTest::Simple is B<explicitly> tested all the way back to perl 5.004.=head1 HISTORYThis module was conceived while talking with Tony Bowden in hiskitchen one night about the problems I was having writing some reallycomplicated feature into the new Testing module.  He observed that themain problem is not dealing with these edge cases but that people hateto write tests B<at all>.  What was needed was a dead simple modulethat took all the hard work out of testing and was really, really easyto learn.  Paul Johnson simultaneously had this idea (unfortunately,he wasn't in Tony's kitchen).  This is it.=head1 AUTHORIdea by Tony Bowden and Paul Johnson, code by Michael G SchwernE<lt>schwern@pobox.comE<gt>, wardrobe by Calvin Klein.=head1 SEE ALSO=over 4=item L<Test::More>More testing functions!  Once you outgrow Test::Simple, look atTest::More.  Test::Simple is 100% forward compatible with Test::More(ie. you can just use Test::More instead of Test::Simple in yourprograms and things will still work).=item L<Test>The original Perl testing module.=item L<Test::Unit>Elaborate unit testing.=item L<Pod::Tests>, L<SelfTest>Embed tests in your code!=item L<Test::Harness>Interprets the output of your test program.=back=cut1;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一级中文字幕精品视频免费观看 | 国产欧美中文在线| 奇米亚洲午夜久久精品| 91精品婷婷国产综合久久性色| 亚洲va欧美va国产va天堂影院| 欧美女孩性生活视频| 五月婷婷激情综合网| 欧美一二三四在线| 国产一区二区免费看| 国产精品伦一区二区三级视频| av一本久道久久综合久久鬼色| 亚洲精品欧美在线| 欧美午夜影院一区| 麻豆精品一区二区三区| 欧美韩日一区二区三区四区| 91在线观看污| 丝袜亚洲精品中文字幕一区| 亚洲一区二区三区四区五区中文| 欧美视频在线一区| 捆绑变态av一区二区三区| 国产农村妇女精品| 在线观看日韩一区| 免费精品99久久国产综合精品| 久久婷婷综合激情| 在线精品亚洲一区二区不卡| 免费看黄色91| 亚洲视频在线一区| 日韩午夜三级在线| 99视频在线精品| 日本不卡视频在线观看| 中文字幕精品在线不卡| 欧美精品电影在线播放| 成人综合激情网| 日韩中文字幕一区二区三区| 久久久精品日韩欧美| 欧美性xxxxx极品少妇| 国产一区中文字幕| 亚洲第一电影网| 国产农村妇女精品| 欧美一区二区三区电影| 99久久婷婷国产综合精品电影| 全国精品久久少妇| 国产一区二区三区四| 亚洲视频一区二区在线观看| 欧美成人三级电影在线| 日本乱码高清不卡字幕| 国产成人免费在线观看| 五月天久久比比资源色| 国产精品久久久久9999吃药| 日韩视频一区二区三区在线播放| 色偷偷久久人人79超碰人人澡| 国内精品第一页| 亚洲gay无套男同| 亚洲美女屁股眼交3| 国产亚洲一二三区| 91精品国产综合久久精品麻豆| 91社区在线播放| 国产成人午夜视频| 久久99精品一区二区三区| 偷拍一区二区三区四区| 中文字幕在线一区二区三区| 久久久久久免费网| 亚洲精品一区二区三区精华液| 欧美日韩国产高清一区二区三区| 日本高清不卡视频| 成人毛片老司机大片| 国产九色精品成人porny| 蜜桃免费网站一区二区三区| 午夜伊人狠狠久久| 亚洲va欧美va国产va天堂影院| 一区二区三区高清| 亚洲综合色噜噜狠狠| 亚洲久草在线视频| 一区二区三区四区不卡在线 | 欧美日韩国产在线播放网站| 99re亚洲国产精品| 91视视频在线观看入口直接观看www | 免费观看成人av| 天堂影院一区二区| 丝袜美腿一区二区三区| 午夜精品影院在线观看| 亚洲夂夂婷婷色拍ww47| 亚洲最新在线观看| 午夜精品一区二区三区三上悠亚| 亚洲mv在线观看| 日韩黄色免费网站| 麻豆国产欧美日韩综合精品二区| 日韩av在线发布| 久久福利视频一区二区| 韩国欧美国产1区| 国产91精品久久久久久久网曝门| 国产成人小视频| av电影天堂一区二区在线观看| 奇米一区二区三区| 色系网站成人免费| 成人深夜福利app| 播五月开心婷婷综合| 处破女av一区二区| 在线视频综合导航| 91麻豆精品国产91久久久久| 欧美成人高清电影在线| 久久久久久99久久久精品网站| 国产欧美日本一区视频| 一区二区日韩电影| 青青草伊人久久| 国产在线观看一区二区| 91丨九色porny丨蝌蚪| 欧美日韩国产一二三| 欧美xxxx老人做受| 国产精品不卡一区二区三区| 亚洲最大成人综合| 久久97超碰国产精品超碰| 北岛玲一区二区三区四区| 久久久久高清精品| 亚洲欧美一区二区三区国产精品| 亚洲国产精品视频| 国产麻豆精品在线| 在线视频一区二区三区| 337p日本欧洲亚洲大胆精品| 亚洲欧美影音先锋| 另类的小说在线视频另类成人小视频在线| 狠狠狠色丁香婷婷综合激情 | 国产精品婷婷午夜在线观看| 亚洲日本va在线观看| 久久精品国产99| 色综合久久88色综合天天免费| 日韩三区在线观看| 亚洲精品国产品国语在线app| 九色综合狠狠综合久久| 欧美在线免费观看亚洲| 国产欧美中文在线| 日本视频免费一区| 91国在线观看| 国产亚洲综合av| 首页亚洲欧美制服丝腿| www.亚洲精品| 26uuu国产一区二区三区| 亚洲午夜久久久久中文字幕久| 国产成人av影院| 日韩精品一区二区三区视频播放 | 99久久精品国产精品久久| 日韩午夜精品视频| 亚洲综合激情小说| 成人精品免费看| www亚洲一区| 奇米综合一区二区三区精品视频| 91亚洲国产成人精品一区二三| 精品盗摄一区二区三区| 婷婷开心激情综合| 欧洲在线/亚洲| 18成人在线视频| 粉嫩欧美一区二区三区高清影视| 日韩免费视频线观看| 午夜久久久久久久久| 在线观看一区二区精品视频| 亚洲欧美一区二区不卡| 成人免费黄色在线| 中文字幕不卡的av| 国产高清视频一区| 精品国产伦一区二区三区观看体验| 午夜欧美2019年伦理| 日本福利一区二区| 一区二区三区免费在线观看| 99国产欧美久久久精品| 国产精品久久久久久久午夜片| 懂色av中文一区二区三区| 久久久国产精华| 国产福利一区二区三区视频在线| 欧美精品一区二区三区一线天视频| 日本三级亚洲精品| 日韩欧美一区二区视频| 久久丁香综合五月国产三级网站| 91精品国产美女浴室洗澡无遮挡| 日日夜夜免费精品| 日韩免费电影一区| 国产揄拍国内精品对白| 欧美国产日韩在线观看| 成人一道本在线| 国产精品午夜电影| 91在线视频播放地址| 国产高清视频一区| 欧美精彩视频一区二区三区| 成人综合婷婷国产精品久久蜜臀| 国产精品视频第一区| 91丨九色丨蝌蚪富婆spa| 亚洲第一成人在线| 欧美成人a视频| 国产成人在线影院| 国产精品高清亚洲| 欧美四级电影网| 日本午夜精品视频在线观看| 久久蜜桃av一区二区天堂| 成人精品视频网站| 亚洲最大色网站| 欧美tickling挠脚心丨vk| 丰满少妇在线播放bd日韩电影| 一区二区三区色| 日韩三级视频在线观看| 成人黄色一级视频| 亚洲福利一二三区|