Upgrade to Devel::PPPort 3.08_02
[p5sagit/p5-mst-13.2.git] / ext / Devel / PPPort / t / sv_xpvf.t
CommitLineData
96ad942f 1################################################################################
2#
3# !!!!! Do NOT edit this file directly! !!!!!
4#
5# Edit mktests.PL and/or parts/inc/sv_xpvf 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';
a745474a 15 if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) {
96ad942f 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 $@;
96ad942f 27 }
c07deaaf 28
29 if (9) {
30 load();
96ad942f 31 plan(tests => 9);
32 }
33}
34
35use Devel::PPPort;
36use strict;
37$^W = 1;
38
39use Tie::Hash;
40my %h;
41tie %h, 'Tie::StdHash';
42$h{foo} = 'foo-';
43$h{bar} = '';
44
45ok(&Devel::PPPort::vnewSVpvf(), $] >= 5.004 ? 'Perl-42' : '%s-%d');
46ok(&Devel::PPPort::sv_vcatpvf('1-2-3-'), $] >= 5.004 ? '1-2-3-Perl-42' : '1-2-3-%s-%d');
47ok(&Devel::PPPort::sv_vsetpvf('1-2-3-'), $] >= 5.004 ? 'Perl-42' : '%s-%d');
48
49&Devel::PPPort::sv_catpvf_mg($h{foo});
50ok($h{foo}, $] >= 5.004 ? 'foo-Perl-42' : 'foo-');
51
52&Devel::PPPort::Perl_sv_catpvf_mg($h{foo});
53ok($h{foo}, $] >= 5.004 ? 'foo-Perl-42-Perl-43' : 'foo-');
54
55&Devel::PPPort::sv_catpvf_mg_nocontext($h{foo});
56ok($h{foo}, $] >= 5.004 ? 'foo-Perl-42-Perl-43-Perl-44' : 'foo-');
57
58&Devel::PPPort::sv_setpvf_mg($h{bar});
59ok($h{bar}, $] >= 5.004 ? 'mhx-42' : '');
60
61&Devel::PPPort::Perl_sv_setpvf_mg($h{bar});
62ok($h{bar}, $] >= 5.004 ? 'foo-43' : '');
63
64&Devel::PPPort::sv_setpvf_mg_nocontext($h{bar});
65ok($h{bar}, $] >= 5.004 ? 'bar-44' : '');
66