Commit | Line | Data |
adfe19db |
1 | ################################################################################ |
2 | # |
3 | # !!!!! Do NOT edit this file directly! !!!!! |
4 | # |
5 | # Edit mktests.PL and/or parts/inc/uv instead. |
6 | # |
7 | ################################################################################ |
8 | |
9 | BEGIN { |
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'; |
a745474a |
15 | if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) { |
adfe19db |
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 | |
24 | eval "use Test"; |
25 | if ($@) { |
26 | require 'testutil.pl'; |
96ad942f |
27 | print "1..10\n"; |
adfe19db |
28 | } |
29 | else { |
96ad942f |
30 | plan(tests => 10); |
adfe19db |
31 | } |
32 | } |
33 | |
34 | use Devel::PPPort; |
35 | use strict; |
36 | $^W = 1; |
37 | |
38 | ok(&Devel::PPPort::sv_setuv(42), 42); |
39 | ok(&Devel::PPPort::newSVuv(123), 123); |
40 | ok(&Devel::PPPort::sv_2uv("4711"), 4711); |
41 | ok(&Devel::PPPort::sv_2uv("1735928559"), 1735928559); |
42 | ok(&Devel::PPPort::SvUVx("1735928559"), 1735928559); |
43 | ok(&Devel::PPPort::SvUVx(1735928559), 1735928559); |
44 | ok(&Devel::PPPort::SvUVx(0xdeadbeef), 0xdeadbeef); |
45 | ok(&Devel::PPPort::XSRETURN_UV(), 42); |
96ad942f |
46 | ok(&Devel::PPPort::PUSHu(), 42); |
47 | ok(&Devel::PPPort::XPUSHu(), 43); |
adfe19db |
48 | |