1N/ABEGIN {
1N/A if( $ENV{PERL_CORE} ) {
1N/A chdir 't';
1N/A @INC = ('../lib', 'lib');
1N/A }
1N/A else {
1N/A unshift @INC, 't/lib';
1N/A }
1N/A}
1N/A
1N/A# Can't use Test.pm, that's a 5.005 thing.
1N/Apackage My::Test;
1N/A
1N/Aprint "1..2\n";
1N/A
1N/Amy $test_num = 1;
1N/A# Utility testing functions.
1N/Asub ok ($;$) {
1N/A my($test, $name) = @_;
1N/A my $ok = '';
1N/A $ok .= "not " unless $test;
1N/A $ok .= "ok $test_num";
1N/A $ok .= " - $name" if defined $name;
1N/A $ok .= "\n";
1N/A print $ok;
1N/A $test_num++;
1N/A}
1N/A
1N/A
1N/Apackage main;
1N/A
1N/Arequire Test::Simple;
1N/A
1N/Arequire Test::Simple::Catch;
1N/Amy($out, $err) = Test::Simple::Catch::caught();
1N/A
1N/ATest::Simple->import(tests => 5);
1N/A
1N/A#line 30
1N/Aok(1, 'Foo');
1N/Aok(0, 'Bar');
1N/A
1N/AEND {
1N/A My::Test::ok($$out eq <<OUT);
1N/A1..5
1N/Aok 1 - Foo
1N/Anot ok 2 - Bar
1N/AOUT
1N/A
1N/A My::Test::ok($$err eq <<ERR);
1N/A# Failed test ($0 at line 31)
1N/A# Looks like you planned 5 tests but only ran 2.
1N/AERR
1N/A
1N/A exit 0;
1N/A}