perltodo.pod: add perlio todos/thinkabouts
[p5sagit/p5-mst-13.2.git] / ext / Devel / PPPort / t / exception.t
CommitLineData
9132e1a3 1################################################################################
2#
3# !!!!! Do NOT edit this file directly! !!!!!
4#
5# Edit mktests.PL and/or parts/inc/exception instead.
6#
7################################################################################
8
9BEGIN {
10 if ($ENV{'PERL_CORE'}) {
11 chdir 't' if -d 't';
12 @INC = ('../lib', '../ext/Devel/PPPort/t') if -d '../lib' && -d '../ext';
13 require Config; import Config;
14 use vars '%Config';
15 if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) {
16 print "1..0 # Skip -- Perl configured without Devel::PPPort module\n";
17 exit 0;
18 }
19 }
20 else {
21 unshift @INC, 't';
22 }
23
c07deaaf 24 sub load {
25 eval "use Test";
26 require 'testutil.pl' if $@;
9132e1a3 27 }
c07deaaf 28
29 if (7) {
30 load();
9132e1a3 31 plan(tests => 7);
32 }
33}
34
35use Devel::PPPort;
36use strict;
37$^W = 1;
38
236afa0a 39package Devel::PPPort;
40use vars '@ISA';
41require DynaLoader;
42@ISA = qw(DynaLoader);
43bootstrap Devel::PPPort;
44
45package main;
46
9132e1a3 47my $rv;
48
49$Devel::PPPort::exception_caught = undef;
50
51$rv = eval { &Devel::PPPort::exception(0) };
52ok($@, '');
53ok(defined $rv);
54ok($rv, 42);
55ok($Devel::PPPort::exception_caught, 0);
56
57$Devel::PPPort::exception_caught = undef;
58
59$rv = eval { &Devel::PPPort::exception(1) };
60ok($@, "boo\n");
61ok(not defined $rv);
62ok($Devel::PPPort::exception_caught, 1);
63