10 @INC = '../lib' if -d '../lib';
19 my ($name, $test_sub) = @_;
20 my $line = (caller)[2];
23 eval { $value = &{ $test_sub }() } ;
28 printf "not ok $test # Testing '$name', line $line $@\n";
31 printf "not ok $test # Testing '$name', line $line, value != 1 ($value)\n";
39 ok "Static newCONSTSUB()",
40 sub { Devel::PPPort::test1(); Devel::PPPort::test_value_1() == 1} ;
42 ok "Global newCONSTSUB()",
43 sub { Devel::PPPort::test2(); Devel::PPPort::test_value_2() == 2} ;
45 ok "Extern newCONSTSUB()",
46 sub { Devel::PPPort::test3(); Devel::PPPort::test_value_3() == 3} ;
48 ok "newRV_inc()", sub { Devel::PPPort::test4()} ;
50 ok "newRV_noinc()", sub { Devel::PPPort::test5()} ;
52 ok "PL_sv_undef", sub { not defined Devel::PPPort::test6()} ;
54 ok "PL_sv_yes", sub { Devel::PPPort::test7()} ;
56 ok "PL_sv_no", sub { !Devel::PPPort::test8()} ;
58 ok "PL_na", sub { Devel::PPPort::test9("abcd") == 4} ;
60 ok "boolSV 1", sub { Devel::PPPort::test10(1) } ;
62 ok "boolSV 0", sub { ! Devel::PPPort::test10(0) } ;
64 ok "newSVpvn", sub { Devel::PPPort::test11("abcde", 3) eq "abc" } ;
66 ok "DEFSV", sub { $_ = "Fred"; Devel::PPPort::test12() eq "Fred" } ;
68 ok "ERRSV", sub { eval { 1; }; ! Devel::PPPort::test13() };
70 ok "ERRSV", sub { eval { fred() }; Devel::PPPort::test13() };
72 ok "CXT 1", sub { Devel::PPPort::test14()} ;
74 ok "CXT 2", sub { Devel::PPPort::test15()} ;