1 ################################################################################
3 # !!!!! Do NOT edit this file directly! !!!!!
5 # Edit mktests.PL and/or parts/inc/Sv_set instead.
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.
11 ################################################################################
16 if ($ENV{'PERL_CORE'}) {
18 unshift @INC, '../lib' if -d '../lib' && -d '../ext';
19 require Config; import Config;
21 if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) {
22 print "1..0 # Skip -- Perl configured without Devel::PPPort module\n";
27 use lib "$FindBin::Bin";
28 use lib "$FindBin::Bin/../parts/inc";
30 die qq[Cannot find "$FindBin::Bin/../parts/inc"] unless -d "$FindBin::Bin/../parts/inc";
33 require 'testutil.pl';
47 package Devel::PPPort;
50 @ISA = qw(DynaLoader);
51 bootstrap Devel::PPPort;
56 ok(&Devel::PPPort::TestSvUV_set($foo, 12345), 42);
57 ok(&Devel::PPPort::TestSvPVX_const("mhx"), 43);
58 ok(&Devel::PPPort::TestSvPVX_mutable("mhx"), 44);
63 ok($bar->x(), 'foobar');
65 Devel::PPPort::TestSvSTASH_set($bar, 'bar');
66 ok($bar->x(), 'hacker');
68 if ( "$]" < '5.007003' ) {
70 skip 'skip: no SV_NOSTEAL support', 0;
73 ok(Devel::PPPort::Test_sv_setsv_SV_NOSTEAL());
75 tie my $scalar, 'TieScalarCounter', 'string';
77 ok tied($scalar)->{fetch}, 0;
78 ok tied($scalar)->{store}, 0;
79 my $copy = Devel::PPPort::newSVsv_nomg($scalar);
80 ok tied($scalar)->{fetch}, 0;
81 ok tied($scalar)->{store}, 0;
84 ok tied($scalar)->{fetch}, 1;
85 ok tied($scalar)->{store}, 0;
86 my $copy2 = Devel::PPPort::newSVsv_nomg($scalar);
87 ok tied($scalar)->{fetch}, 1;
88 ok tied($scalar)->{store}, 0;
92 package TieScalarCounter;
95 my ($class, $value) = @_;
96 return bless { fetch => 0, store => 0, value => $value }, $class;
102 return $self->{value};
106 my ($self, $value) = @_;
108 $self->{value} = $value;