diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-03-31 16:19:38 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-03-31 16:19:38 +0000 |
commit | 71860c90dc88c6ecf9e7802ba5a4626286e10926 (patch) | |
tree | 797367403200133db5a4884c5341470bd21258fc /t | |
parent | 06e0342d2aba1f50e6c4b29e9bb429e6470f813b (diff) | |
download | perl-71860c90dc88c6ecf9e7802ba5a4626286e10926.tar.gz |
Test that entries in %^H are actually independant.
p4raw-id: //depot/perl@27646
Diffstat (limited to 't')
-rw-r--r-- | t/op/caller.t | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/t/op/caller.t b/t/op/caller.t index 1bbd2621fb..6e8bfdc05e 100644 --- a/t/op/caller.t +++ b/t/op/caller.t @@ -5,7 +5,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; - plan( tests => 48 ); + plan( tests => 56 ); } my @c; @@ -116,21 +116,32 @@ $i = eval $debugger_test; 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 +print "# caller can now return the compile time state of %^H\n"; + +sub get_hash { + my $level = shift; + my @results = caller($level||0); + $results[10]; +} + sub get_dooot { my $level = shift; my @results = caller($level||0); $results[10]->{dooot}; } -sub get_hash { + +sub get_thikoosh { my $level = shift; my @results = caller($level||0); - $results[10]; + $results[10]->{thikoosh}; } + sub dooot { is(get_dooot(), undef); + is(get_thikoosh(), undef); my $hash = get_hash(); ok(!exists $hash->{dooot}); + ok(!exists $hash->{thikoosh}); is(get_dooot(1), 54); BEGIN { $^H{dooot} = 42; @@ -155,10 +166,13 @@ sub dooot { } { is(get_dooot(), undef); + is(get_thikoosh(), undef); BEGIN { $^H{dooot} = 1; + $^H{thikoosh} = "SKREECH"; } - is(get_dooot(), 1); + is(get_dooot(), 1); + is(get_thikoosh(), "SKREECH"); BEGIN { $^H{dooot} = 42; @@ -169,6 +183,7 @@ sub dooot { $^H{dooot} = 6 * 9; } is(get_dooot(), 54); + is(get_thikoosh(), "SKREECH"); { BEGIN { delete $^H{dooot}; @@ -176,10 +191,13 @@ sub dooot { is(get_dooot(), undef); my $hash = get_hash(); ok(!exists $hash->{dooot}); + is(get_thikoosh(), "SKREECH"); } dooot(); } is(get_dooot(), 6 * 7); + is(get_thikoosh(), "SKREECH"); } is(get_dooot(), 6 * 7); + is(get_thikoosh(), "SKREECH"); } |