Rename ext/Devel/PPPort to ext/Devel-PPPort
[p5sagit/p5-mst-13.2.git] / ext / Devel-PPPort / t / warn.t
CommitLineData
f2ab5a41 1################################################################################
2#
3# !!!!! Do NOT edit this file directly! !!!!!
4#
5# Edit mktests.PL and/or parts/inc/warn 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#
f2ab5a41 11################################################################################
12
13BEGIN {
14 if ($ENV{'PERL_CORE'}) {
15 chdir 't' if -d 't';
0ff33da8 16 @INC = ('../lib', '../ext/Devel-PPPort/t') if -d '../lib' && -d '../ext';
f2ab5a41 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 $@;
f2ab5a41 31 }
c07deaaf 32
33 if (5) {
34 load();
f2ab5a41 35 plan(tests => 5);
36 }
37}
38
39use Devel::PPPort;
40use strict;
41$^W = 1;
42
236afa0a 43package Devel::PPPort;
44use vars '@ISA';
45require DynaLoader;
46@ISA = qw(DynaLoader);
47bootstrap Devel::PPPort;
48
49package main;
50
f2ab5a41 51$^W = 0;
52
53my $warning;
54
55$SIG{'__WARN__'} = sub { $warning = $_[0] };
56
57$warning = '';
58Devel::PPPort::warner();
59ok($] >= 5.004 ? $warning =~ /^warner bar:42/ : $warning eq '');
60
61$warning = '';
62Devel::PPPort::Perl_warner();
63ok($] >= 5.004 ? $warning =~ /^Perl_warner bar:42/ : $warning eq '');
64
65$warning = '';
66Devel::PPPort::Perl_warner_nocontext();
67ok($] >= 5.004 ? $warning =~ /^Perl_warner_nocontext bar:42/ : $warning eq '');
68
69$warning = '';
70Devel::PPPort::ckWARN();
71ok($warning, '');
72
73$^W = 1;
74
75$warning = '';
76Devel::PPPort::ckWARN();
77ok($] >= 5.004 ? $warning =~ /^ckWARN bar:42/ : $warning eq '');
78