From: Nicholas Clark Date: Wed, 11 Apr 2007 19:48:36 +0000 (+0000) Subject: For symbolic references test the defined path through the pp functions. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fc4809d700f2d81f10c2f880a711ccb8f5f82094;p=p5sagit%2Fp5-mst-13.2.git For symbolic references test the defined path through the pp functions. p4raw-id: //depot/perl@30915 --- diff --git a/t/op/ref.t b/t/op/ref.t index ba9aacf..3fdc833 100755 --- a/t/op/ref.t +++ b/t/op/ref.t @@ -8,7 +8,7 @@ BEGIN { require 'test.pl'; use strict qw(refs subs); -plan(128); +plan(138); # Test glob operations. @@ -427,6 +427,10 @@ TODO: { is ($$name1, "Yummy", 'Accessing via the correct name works'); is ($$name2, undef, 'Accessing via a different NUL-containing name gives nothing'); + # defined uses a different code path + ok (defined $$name1, 'defined via the correct name works'); + ok (!defined $$name2, + 'defined via a different NUL-containing name gives nothing'); is ($name1->[0], undef, 'Nothing before we start (arrays)'); is ($name2->[0], undef, 'Nothing before we start'); @@ -434,6 +438,9 @@ TODO: { is ($name1->[0], "Yummy", 'Accessing via the correct name works'); is ($name2->[0], undef, 'Accessing via a different NUL-containing name gives nothing'); + ok (defined $name1->[0], 'defined via the correct name works'); + ok (!defined$name2->[0], + 'defined via a different NUL-containing name gives nothing'); my (undef, $one) = @{$name1}[2,3]; my (undef, $two) = @{$name2}[2,3]; @@ -445,6 +452,9 @@ TODO: { is ($one, "Yummy", 'Accessing via the correct name works'); is ($two, undef, 'Accessing via a different NUL-containing name gives nothing'); + ok (defined $one, 'defined via the correct name works'); + ok (!defined $two, + 'defined via a different NUL-containing name gives nothing'); is ($name1->{PWOF}, undef, 'Nothing before we start (hashes)'); is ($name2->{PWOF}, undef, 'Nothing before we start'); @@ -452,6 +462,9 @@ TODO: { is ($name1->{PWOF}, "Yummy", 'Accessing via the correct name works'); is ($name2->{PWOF}, undef, 'Accessing via a different NUL-containing name gives nothing'); + ok (defined $name1->{PWOF}, 'defined via the correct name works'); + ok (!defined $name2->{PWOF}, + 'defined via a different NUL-containing name gives nothing'); my (undef, $one) = @{$name1}{'SNIF', 'BEEYOOP'}; my (undef, $two) = @{$name2}{'SNIF', 'BEEYOOP'}; @@ -463,6 +476,9 @@ TODO: { is ($one, "Yummy", 'Accessing via the correct name works'); is ($two, undef, 'Accessing via a different NUL-containing name gives nothing'); + ok (defined $one, 'defined via the correct name works'); + ok (!defined $two, + 'defined via a different NUL-containing name gives nothing'); $name1 = "Left"; $name2 = "Left\0Right"; my $glob2 = *{$name2};