Commit | Line | Data |
9132e1a3 |
1 | ################################################################################ |
2 | # |
3 | # !!!!! Do NOT edit this file directly! !!!!! |
4 | # |
5 | # Edit mktests.PL and/or parts/inc/exception instead. |
6 | # |
cac25305 |
7 | # This file was automatically generated from the definition files in the |
8 | # parts/inc/ subdirectory by mktests.PL. To learn more about how all this |
9 | # works, please read the F<HACKERS> file that came with this distribution. |
10 | # |
9132e1a3 |
11 | ################################################################################ |
12 | |
13 | BEGIN { |
14 | if ($ENV{'PERL_CORE'}) { |
15 | chdir 't' if -d 't'; |
0ff33da8 |
16 | @INC = ('../lib', '../ext/Devel-PPPort/t') if -d '../lib' && -d '../ext'; |
9132e1a3 |
17 | require Config; import Config; |
18 | use vars '%Config'; |
19 | if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) { |
20 | print "1..0 # Skip -- Perl configured without Devel::PPPort module\n"; |
21 | exit 0; |
22 | } |
23 | } |
24 | else { |
25 | unshift @INC, 't'; |
26 | } |
27 | |
c07deaaf |
28 | sub load { |
29 | eval "use Test"; |
30 | require 'testutil.pl' if $@; |
9132e1a3 |
31 | } |
c07deaaf |
32 | |
33 | if (7) { |
34 | load(); |
9132e1a3 |
35 | plan(tests => 7); |
36 | } |
37 | } |
38 | |
39 | use Devel::PPPort; |
40 | use strict; |
41 | $^W = 1; |
42 | |
236afa0a |
43 | package Devel::PPPort; |
44 | use vars '@ISA'; |
45 | require DynaLoader; |
46 | @ISA = qw(DynaLoader); |
47 | bootstrap Devel::PPPort; |
48 | |
49 | package main; |
50 | |
9132e1a3 |
51 | my $rv; |
52 | |
53 | $Devel::PPPort::exception_caught = undef; |
54 | |
55 | $rv = eval { &Devel::PPPort::exception(0) }; |
56 | ok($@, ''); |
57 | ok(defined $rv); |
58 | ok($rv, 42); |
59 | ok($Devel::PPPort::exception_caught, 0); |
60 | |
61 | $Devel::PPPort::exception_caught = undef; |
62 | |
63 | $rv = eval { &Devel::PPPort::exception(1) }; |
64 | ok($@, "boo\n"); |
65 | ok(not defined $rv); |
66 | ok($Devel::PPPort::exception_caught, 1); |
67 | |