extra code in pp_concat, Take 2
[p5sagit/p5-mst-13.2.git] / lib / Internals.t
CommitLineData
29569577 1#!/usr/bin/perl -Tw
2
3BEGIN {
4 if( $ENV{PERL_CORE} ) {
5 @INC = '../lib';
6 chdir 't';
7 }
8}
9
14a976d6 10use Test::More tests => 33;
29569577 11
12my $foo;
14a976d6 13my @foo;
14my %foo;
29569577 15
16ok( !Internals::SvREADONLY $foo );
17ok( Internals::SvREADONLY $foo, 1 );
18ok( Internals::SvREADONLY $foo );
19ok( !Internals::SvREADONLY $foo, 0 );
20ok( !Internals::SvREADONLY $foo );
21
22ok( !Internals::SvREADONLY @foo );
23ok( Internals::SvREADONLY @foo, 1 );
24ok( Internals::SvREADONLY @foo );
25ok( !Internals::SvREADONLY @foo, 0 );
26ok( !Internals::SvREADONLY @foo );
27
28ok( !Internals::SvREADONLY $foo[2] );
29ok( Internals::SvREADONLY $foo[2], 1 );
30ok( Internals::SvREADONLY $foo[2] );
31ok( !Internals::SvREADONLY $foo[2], 0 );
32ok( !Internals::SvREADONLY $foo[2] );
33
34ok( !Internals::SvREADONLY %foo );
35ok( Internals::SvREADONLY %foo, 1 );
36ok( Internals::SvREADONLY %foo );
37ok( !Internals::SvREADONLY %foo, 0 );
38ok( !Internals::SvREADONLY %foo );
39
40ok( !Internals::SvREADONLY $foo{foo} );
41ok( Internals::SvREADONLY $foo{foo}, 1 );
42ok( Internals::SvREADONLY $foo{foo} );
43ok( !Internals::SvREADONLY $foo{foo}, 0 );
44ok( !Internals::SvREADONLY $foo{foo} );
45
46is( Internals::SvREFCNT($foo), 1 );
47{
48 my $bar = \$foo;
49 is( Internals::SvREFCNT($foo), 2 );
50 is( Internals::SvREFCNT($bar), 1 );
51}
52is( Internals::SvREFCNT($foo), 1 );
53
14a976d6 54is( Internals::SvREFCNT(@foo), 1 );
55is( Internals::SvREFCNT($foo[2]), 1 );
56is( Internals::SvREFCNT(%foo), 1 );
57is( Internals::SvREFCNT($foo{foo}), 1 );
58