chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
- plan( tests => 48 );
+ plan( tests => 78 );
}
my @c;
testwarn("\0" x 12);
use warnings;
- BEGIN { is( ${^WARNING_BITS}, "UUUUUUUUUUU\025", 'default bits on via "use warnings"' ); }
- BEGIN { testwarn("UUUUUUUUUUU\025", "#1"); }
+ BEGIN { is( ${^WARNING_BITS}, "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\025", 'default bits on via "use warnings"' ); }
+ BEGIN { testwarn("\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\025", "#1"); }
# run-time :
# the warning mask has been extended by warnings::register
- testwarn("UUUUUUUUUUUU");
+ testwarn("\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55");
use warnings::register;
- BEGIN { is( ${^WARNING_BITS}, "UUUUUUUUUUUU", 'warning bits on via "use warnings::register"' ) }
- testwarn("UUUUUUUUUUUU","#3");
+ BEGIN { is( ${^WARNING_BITS}, "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55", 'warning bits on via "use warnings::register"' ) }
+ testwarn("\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55","#3");
}
is( $i, 11, 'do not skip over eval even if $^P had been on at some point' );
is( eval 'pb()', 'main::pb', 'actually return the right function name even if $^P had been on at some point' );
-# caller can now return the compile time state of %^H
-sub get_dooot {
+print "# caller can now return the compile time state of %^H\n";
+
+sub hint_exists {
+ my $key = shift;
my $level = shift;
my @results = caller($level||0);
- $results[10]->{dooot};
+ exists $results[10]->{$key};
}
-sub get_hash {
+
+sub hint_fetch {
+ my $key = shift;
my $level = shift;
my @results = caller($level||0);
- $results[10];
-}
-sub dooot {
- is(get_dooot(), undef);
- my $hash = get_hash();
- ok(!exists $hash->{dooot});
- is(get_dooot(1), 54);
- BEGIN {
- $^H{dooot} = 42;
- }
- is(get_dooot(), 6 * 7);
- is(get_dooot(1), 54);
-
- BEGIN {
- $^H{dooot} = undef;
- }
- is(get_dooot(), undef);
- $hash = get_hash();
- ok(exists $hash->{dooot});
-
- BEGIN {
- delete $^H{dooot};
- }
- is(get_dooot(), undef);
- $hash = get_hash();
- ok(!exists $hash->{dooot});
- is(get_dooot(1), 54);
-}
-{
- is(get_dooot(), undef);
- BEGIN {
- $^H{dooot} = 1;
- }
- is(get_dooot(), 1);
-
- BEGIN {
- $^H{dooot} = 42;
- }
- {
- {
- BEGIN {
- $^H{dooot} = 6 * 9;
- }
- is(get_dooot(), 54);
- {
- BEGIN {
- delete $^H{dooot};
- }
- is(get_dooot(), undef);
- my $hash = get_hash();
- ok(!exists $hash->{dooot});
- }
- dooot();
- }
- is(get_dooot(), 6 * 7);
- }
- is(get_dooot(), 6 * 7);
+ $results[10]->{$key};
}
+
+$::testing_caller = 1;
+
+do './op/caller.pl';