Rename ext/Devel/PPPort to ext/Devel-PPPort
[p5sagit/p5-mst-13.2.git] / ext / Devel-PPPort / t / variables.t
CommitLineData
0d0f8426 1################################################################################
2#
3# !!!!! Do NOT edit this file directly! !!!!!
4#
5# Edit mktests.PL and/or parts/inc/variables 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#
0d0f8426 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';
0d0f8426 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 $@;
0d0f8426 31 }
c07deaaf 32
c01be2ce 33 if (49) {
c07deaaf 34 load();
c01be2ce 35 plan(tests => 49);
0d0f8426 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
0d0f8426 51ok(Devel::PPPort::compare_PL_signals());
52
cac25305 53ok(!defined(&Devel::PPPort::PL_sv_undef()));
54ok(&Devel::PPPort::PL_sv_yes());
55ok(!&Devel::PPPort::PL_sv_no());
56ok(&Devel::PPPort::PL_na("abcd"), 4);
57ok(&Devel::PPPort::PL_Sv(), "mhx");
c01be2ce 58ok(defined &Devel::PPPort::PL_tokenbuf());
59ok($] >= 5.009005 || &Devel::PPPort::PL_parser());
cac25305 60ok(&Devel::PPPort::PL_hexdigit() =~ /^[0-9a-zA-Z]+$/);
61ok(defined &Devel::PPPort::PL_hints());
62ok(&Devel::PPPort::PL_ppaddr("mhx"), "MHX");
63
64for (&Devel::PPPort::other_variables()) {
65 ok($_ != 0);
66}
67
c01be2ce 68{
69 my @w;
70 my $fail = 0;
71 {
72 local $SIG{'__WARN__'} = sub { push @w, @_ };
73 ok(&Devel::PPPort::dummy_parser_warning());
74 }
75 if ($] >= 5.009005) {
76 ok(@w >= 0);
77 for (@w) {
78 print "# $_";
79 unless (/^warning: dummy PL_bufptr used in.*module3.*:\d+/i) {
80 warn $_;
81 $fail++;
82 }
83 }
84 }
85 else {
86 ok(@w == 0);
87 }
88 ok($fail, 0);
89}
90
91ok(&Devel::PPPort::no_dummy_parser_vars(1) >= ($] < 5.009005 ? 1 : 0));
92
93eval { &Devel::PPPort::no_dummy_parser_vars(0) };
94
95if ($] < 5.009005) {
96 ok($@, '');
97}
98else {
99 if ($@) {
100 print "# $@";
101 ok($@ =~ /^panic: PL_parser == NULL in.*module2.*:\d+/i);
102 }
103 else {
104 ok(1);
105 }
106}
107