svsetsv.t revision 1.1.1.1
1BEGIN {
2    chdir 't' if -d 't';
3    @INC = '../lib';
4    push @INC, "::lib:$MacPerl::Architecture:" if $^O eq 'MacOS';
5    require Config; import Config;
6    if ($Config{'extensions'} !~ /\bXS\/APItest\b/) {
7        print "1..0 # Skip: XS::APItest was not built\n";
8        exit 0;
9    }
10}
11
12use strict;
13use warnings;
14
15use Test::More tests => 3;
16
17BEGIN { use_ok('XS::APItest') };
18
19# I can't see a good way to easily get back perl-space diagnostics for these
20# I hope that this isn't a problem.
21if ($] > 5.009) {
22  ok(sv_setsv_cow_hashkey_core,
23     "With PERL_CORE sv_setsv does COW for shared hash key scalars");
24} else {
25  ok(!sv_setsv_cow_hashkey_core,
26     "With PERL_CORE on 5.8.x sv_setsv doesn't COW for shared hash key scalars");
27}
28
29ok(!sv_setsv_cow_hashkey_notcore,
30   "Without PERL_CORE sv_setsv doesn't COW for shared hash key scalars");
31