This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move Devel::PPPort from ext/ to cpan/
[perl5.git] / cpan / Devel-PPPort / t / Sv_set.t
CommitLineData
0d0f8426
MHM
1################################################################################
2#
3# !!!!! Do NOT edit this file directly! !!!!!
4#
5# Edit mktests.PL and/or parts/inc/Sv_set instead.
6#
cac25305
MHM
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#
0d0f8426
MHM
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';
0d0f8426
MHM
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
c07deaaf
MHM
28 sub load {
29 eval "use Test";
30 require 'testutil.pl' if $@;
0d0f8426 31 }
c07deaaf
MHM
32
33 if (5) {
34 load();
f2ab5a41 35 plan(tests => 5);
0d0f8426
MHM
36 }
37}
38
39use Devel::PPPort;
40use strict;
41$^W = 1;
42
236afa0a
MHM
43package Devel::PPPort;
44use vars '@ISA';
45require DynaLoader;
46@ISA = qw(DynaLoader);
47bootstrap Devel::PPPort;
48
49package main;
50
0d0f8426
MHM
51my $foo = 5;
52ok(&Devel::PPPort::TestSvUV_set($foo, 12345), 42);
53ok(&Devel::PPPort::TestSvPVX_const("mhx"), 43);
54ok(&Devel::PPPort::TestSvPVX_mutable("mhx"), 44);
55
f2ab5a41
MHM
56my $bar = [];
57
58bless $bar, 'foo';
59ok($bar->x(), 'foobar');
60
61Devel::PPPort::TestSvSTASH_set($bar, 'bar');
62ok($bar->x(), 'hacker');
63
64package foo;
65
66sub x { 'foobar' }
67
68package bar;
69
70sub x { 'hacker' }
71