Re: [PATCH] Hash::Util::FieldHash
[p5sagit/p5-mst-13.2.git] / ext / Devel / PPPort / t / Sv_set.t
CommitLineData
0d0f8426 1################################################################################
2#
3# !!!!! Do NOT edit this file directly! !!!!!
4#
5# Edit mktests.PL and/or parts/inc/Sv_set 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';
15 if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) {
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 $@;
0d0f8426 27 }
c07deaaf 28
29 if (5) {
30 load();
f2ab5a41 31 plan(tests => 5);
0d0f8426 32 }
33}
34
35use Devel::PPPort;
36use strict;
37$^W = 1;
38
39my $foo = 5;
40ok(&Devel::PPPort::TestSvUV_set($foo, 12345), 42);
41ok(&Devel::PPPort::TestSvPVX_const("mhx"), 43);
42ok(&Devel::PPPort::TestSvPVX_mutable("mhx"), 44);
43
f2ab5a41 44my $bar = [];
45
46bless $bar, 'foo';
47ok($bar->x(), 'foobar');
48
49Devel::PPPort::TestSvSTASH_set($bar, 'bar');
50ok($bar->x(), 'hacker');
51
52package foo;
53
54sub x { 'foobar' }
55
56package bar;
57
58sub x { 'hacker' }
59