4 if( $ENV{PERL_CORE} ) {
6 @INC = ('../lib', 'lib');
14 # Turn on threads here, if available, since this test tends to find
15 # lots of threading bugs.
18 if( $] >= 5.008 && $Config{useithreads} ) {
27 use Test::More tests => 5;
29 my $Test = Test::More->builder;
31 # now make a filehandle where we can send data
33 my $output = tie *FAKEOUT, 'TieOut';
35 # force diagnostic output to a filehandle, glad I added this to
40 $Test->todo_output(\*FAKEOUT);
42 diag("a single line");
44 $ret = diag("multiple\n", "lines");
47 is( $output->read, <<'DIAG', 'diag() with todo_output set' );
53 ok( !$ret, 'diag returns false' );
56 $Test->failure_output(\*FAKEOUT);
59 $Test->failure_output(\*STDERR);
60 is( $output->read, "# # foo\n", "diag() adds # even if there's one already" );
61 ok( !$ret, 'diag returns false' );
66 $Test->failure_output(\*FAKEOUT);
69 $Test->failure_output(\*STDERR);
70 is( $output->read, <<'DIAG' );