Move Devel::PPPort from ext/ to cpan/
[p5sagit/p5-mst-13.2.git] / cpan / 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#
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#
96ad942f 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';
96ad942f 17 require Config; import Config;
18 use vars '%Config';
a745474a 19 if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) {
96ad942f 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 $@;
96ad942f 31 }
c07deaaf 32
33 if (9) {
34 load();
96ad942f 35 plan(tests => 9);
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
96ad942f 51use Tie::Hash;
52my %h;
53tie %h, 'Tie::StdHash';
54$h{foo} = 'foo-';
55$h{bar} = '';
56
57ok(&Devel::PPPort::vnewSVpvf(), $] >= 5.004 ? 'Perl-42' : '%s-%d');
58ok(&Devel::PPPort::sv_vcatpvf('1-2-3-'), $] >= 5.004 ? '1-2-3-Perl-42' : '1-2-3-%s-%d');
59ok(&Devel::PPPort::sv_vsetpvf('1-2-3-'), $] >= 5.004 ? 'Perl-42' : '%s-%d');
60
61&Devel::PPPort::sv_catpvf_mg($h{foo});
62ok($h{foo}, $] >= 5.004 ? 'foo-Perl-42' : 'foo-');
63
64&Devel::PPPort::Perl_sv_catpvf_mg($h{foo});
65ok($h{foo}, $] >= 5.004 ? 'foo-Perl-42-Perl-43' : 'foo-');
66
67&Devel::PPPort::sv_catpvf_mg_nocontext($h{foo});
68ok($h{foo}, $] >= 5.004 ? 'foo-Perl-42-Perl-43-Perl-44' : 'foo-');
69
70&Devel::PPPort::sv_setpvf_mg($h{bar});
71ok($h{bar}, $] >= 5.004 ? 'mhx-42' : '');
72
73&Devel::PPPort::Perl_sv_setpvf_mg($h{bar});
74ok($h{bar}, $] >= 5.004 ? 'foo-43' : '');
75
76&Devel::PPPort::sv_setpvf_mg_nocontext($h{bar});
77ok($h{bar}, $] >= 5.004 ? 'bar-44' : '');
78