5 if( $ENV{PERL_CORE} ) {
7 @INC = ('../lib', 'lib');
10 unshift @INC, 't/lib';
16 # Can't use Test.pm, that's a 5.005 thing.
20 # Utility testing functions.
22 my($test, $name) = @_;
24 $ok .= "not " unless $test;
25 $ok .= "ok $test_num";
26 $ok .= " - $name" if defined $name;
36 my $Test = Test::Builder->new();
39 my $tmpfile = 'foo.tmp';
40 my $out = $Test->output($tmpfile);
41 END { 1 while unlink($tmpfile) }
49 open(IN, $tmpfile) or die $!;
50 chomp(my $line = <IN>);
55 open(FOO, ">>$tmpfile") or die $!;
56 $out = $Test->output(\*FOO);
62 open(IN, $tmpfile) or die $!;
66 ok($lines[1] =~ /Hello!/);
70 # Ensure stray newline in name escaping works.
71 $out = tie *FAKEOUT, 'TieOut';
72 $Test->output(\*FAKEOUT);
73 $Test->exported_to(__PACKAGE__);
75 $Test->plan(tests => 5);
79 $Test->ok(1, "ok, like\nok");
80 $Test->skip("wibble\nmoof");
81 $Test->todo_skip("todo\nskip\n");
83 my $output = $out->read;
84 ok( $output eq <<OUTPUT ) || print STDERR $output;
93 not ok 5 # TODO & SKIP todo