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

📄 diag.t

📁 source of perl for linux application,
💻 T
字号:
#!perl -wBEGIN {    if( $ENV{PERL_CORE} ) {        chdir 't';        @INC = ('../lib', 'lib');    }    else {        unshift @INC, 't/lib';    }}# Turn on threads here, if available, since this test tends to find# lots of threading bugs.use Config;BEGIN {    if( $] >= 5.008001 && $Config{useithreads} ) {        require threads;        'threads'->import;    }}use strict;use Test::More tests => 5;my $Test = Test::More->builder;# now make a filehandle where we can send datause TieOut;my $output = tie *FAKEOUT, 'TieOut';# force diagnostic output to a filehandle, glad I added this to# Test::Builder :)my $ret;{    local $TODO = 1;    $Test->todo_output(\*FAKEOUT);    diag("a single line");    $ret = diag("multiple\n", "lines");}is( $output->read, <<'DIAG',   'diag() with todo_output set' );# a single line# multiple# linesDIAGok( !$ret, 'diag returns false' );{    $Test->failure_output(\*FAKEOUT);    $ret = diag("# foo");}$Test->failure_output(\*STDERR);is( $output->read, "# # foo\n", "diag() adds # even if there's one already" );ok( !$ret,  'diag returns false' );# [rt.cpan.org 8392]{    $Test->failure_output(\*FAKEOUT);    diag(qw(one two));}$Test->failure_output(\*STDERR);is( $output->read, <<'DIAG' );# onetwoDIAG

⌨️ 快捷键说明

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