File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -5995,6 +5995,7 @@ t/op/sub.t See if subroutines work
59955995t/op/sub_lval.t See if lvalue subroutines work
59965996t/op/substr.t See if substr works
59975997t/op/substr_thr.t See if substr works in another thread
5998+ t/op/svflags.t See if POK is set as expected.
59985999t/op/svleak.pl Test file for svleak.t
59996000t/op/svleak.t See if stuff leaks SVs
60006001t/op/switch.t See if switches (given/when) work
Original file line number Diff line number Diff line change 1+ # !./perl
2+
3+ BEGIN {
4+ chdir ' t' if -d ' t' ;
5+ require ' ./test.pl' ;
6+ set_up_inc(' ../lib' );
7+ skip_all(" need B, need full perl" ) if is_miniperl();
8+ }
9+
10+ # Tests the new documented mechanism for determining the original type
11+ # of an SV.
12+
13+ plan tests => 4;
14+ use strict;
15+ use B qw( svref_2object SVf_IOK SVf_NOK SVf_POK) ;
16+
17+ my $x = 10;
18+ my $xobj = svref_2object(\$x );
19+ is($xobj -> FLAGS & (SVf_IOK | SVf_POK), SVf_IOK, " correct base flags on IV" );
20+
21+ my $y = $x . " " ;
22+
23+ is($xobj -> FLAGS & (SVf_IOK | SVf_POK), SVf_IOK, " POK not set on IV used as string" );
24+
25+ $x = " 10" ;
26+ is($xobj -> FLAGS & (SVf_IOK | SVf_POK), SVf_POK, " correct base flags on PV" );
27+
28+ $y = $x + 10;
29+
30+ is($xobj -> FLAGS & (SVf_IOK | SVf_POK), (SVf_IOK | SVf_POK), " POK still set on PV used as number" );
You can’t perform that action at this time.
0 commit comments