Commit | Line | Data |
c1a049cb |
1 | ################################################################################ |
2 | # |
3 | # !!!!! Do NOT edit this file directly! !!!!! |
4 | # |
5 | # Edit mktests.PL and/or parts/inc/newSVpv instead. |
6 | # |
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 | # |
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'; |
c1a049cb |
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 | |
28 | sub load { |
29 | eval "use Test"; |
30 | require 'testutil.pl' if $@; |
31 | } |
32 | |
33 | if (15) { |
34 | load(); |
35 | plan(tests => 15); |
36 | } |
37 | } |
38 | |
39 | use Devel::PPPort; |
40 | use strict; |
41 | $^W = 1; |
42 | |
43 | package Devel::PPPort; |
44 | use vars '@ISA'; |
45 | require DynaLoader; |
46 | @ISA = qw(DynaLoader); |
47 | bootstrap Devel::PPPort; |
48 | |
49 | package main; |
50 | |
51 | my @s = &Devel::PPPort::newSVpvn(); |
52 | ok(@s == 5); |
53 | ok($s[0], "test"); |
54 | ok($s[1], "te"); |
55 | ok($s[2], ""); |
56 | ok(!defined($s[3])); |
57 | ok(!defined($s[4])); |
58 | |
59 | @s = &Devel::PPPort::newSVpvn_flags(); |
60 | ok(@s == 5); |
61 | ok($s[0], "test"); |
62 | ok($s[1], "te"); |
63 | ok($s[2], ""); |
64 | ok(!defined($s[3])); |
65 | ok(!defined($s[4])); |
66 | |
67 | @s = &Devel::PPPort::newSVpvn_utf8(); |
68 | ok(@s == 1); |
69 | ok($s[0], "test"); |
70 | |
71 | if ($] >= 5.008001) { |
72 | require utf8; |
73 | ok(utf8::is_utf8($s[0])); |
74 | } |
75 | else { |
76 | skip("skip: no is_utf8()", 0); |
77 | } |
78 | |