4 if( $ENV{PERL_CORE} ) {
6 @INC = ('../lib', 'lib');
13 # Can't use Test.pm, that's a 5.005 thing.
17 # Utility testing functions.
19 my($test, $name) = @_;
21 $ok .= "not " unless $test;
22 $ok .= "ok $test_num";
23 $ok .= " - $name" if defined $name;
33 my $Test = Test::Builder->new();
36 my $out = $Test->output('foo');
44 open(IN, 'foo') or die $!;
45 chomp(my $line = <IN>);
50 open(FOO, ">>foo") or die $!;
51 $out = $Test->output(\*FOO);
57 open(IN, 'foo') or die $!;
61 ok($lines[1] =~ /Hello!/);
66 # Ensure stray newline in name escaping works.
67 $out = tie *FAKEOUT, 'TieOut';
68 $Test->output(\*FAKEOUT);
69 $Test->exported_to(__PACKAGE__);
71 $Test->plan(tests => 5);
75 $Test->ok(1, "ok, like\nok");
76 $Test->skip("wibble\nmoof");
77 $Test->todo_skip("todo\nskip\n");
79 my $output = $out->read;
80 ok( $output eq <<OUTPUT ) || print STDERR $output;
89 not ok 5 # TODO & SKIP todo