From: Gurusamy Sarathy Date: Wed, 4 Mar 1998 02:00:15 +0000 (+0000) Subject: [win32] renumber some tests to match maint branch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2bb40b7f9f696f78f932ef8d368a2b2dea2c0bbb;p=p5sagit%2Fp5-mst-13.2.git [win32] renumber some tests to match maint branch p4raw-id: //depot/win32/perl@725 --- diff --git a/t/op/local.t b/t/op/local.t index 1a8daac..0df1b6d 100755 --- a/t/op/local.t +++ b/t/op/local.t @@ -53,53 +53,51 @@ print +($@ =~ /Can't localize through a reference/) ? "" : "not ", "ok 22\n"; eval 'local(%$e)'; print +($@ =~ /Can't localize through a reference/) ? "" : "not ", "ok 23\n"; -# check for scope leakage - -$a = 'outer'; -if (1) { local $a = 'inner' } -print +($a eq 'outer') ? "" : "not ", "ok 24\n"; - -# see if localization works when scope unwinds - -local $m = 5; -eval { - for $m (6) { - local $m = 7; - die "bye"; - } -}; -print $m == 5 ? "" : "not ", "ok 25\n"; - # Array and hash elements @a = ('a', 'b', 'c'); { local($a[1]) = 'foo'; local($a[2]) = $a[2]; - print +($a[1] eq 'foo') ? "" : "not ", "ok 26\n"; - print +($a[2] eq 'c') ? "" : "not ", "ok 27\n"; + print +($a[1] eq 'foo') ? "" : "not ", "ok 24\n"; + print +($a[2] eq 'c') ? "" : "not ", "ok 25\n"; undef @a; } -print +($a[1] eq 'b') ? "" : "not ", "ok 28\n"; -print +($a[2] eq 'c') ? "" : "not ", "ok 29\n"; -print +(!defined $a[0]) ? "" : "not ", "ok 30\n"; +print +($a[1] eq 'b') ? "" : "not ", "ok 26\n"; +print +($a[2] eq 'c') ? "" : "not ", "ok 27\n"; +print +(!defined $a[0]) ? "" : "not ", "ok 28\n"; @a = ('a', 'b', 'c'); { local($a[1]) = "X"; shift @a; } -print +($a[0].$a[1] eq "Xb") ? "" : "not ", "ok 31\n"; +print +($a[0].$a[1] eq "Xb") ? "" : "not ", "ok 29\n"; %h = ('a' => 1, 'b' => 2, 'c' => 3); { local($h{'a'}) = 'foo'; local($h{'b'}) = $h{'b'}; - print +($h{'a'} eq 'foo') ? "" : "not ", "ok 32\n"; - print +($h{'b'} == 2) ? "" : "not ", "ok 33\n"; + print +($h{'a'} eq 'foo') ? "" : "not ", "ok 30\n"; + print +($h{'b'} == 2) ? "" : "not ", "ok 31\n"; local($h{'c'}); delete $h{'c'}; } -print +($h{'a'} == 1) ? "" : "not ", "ok 34\n"; -print +($h{'b'} == 2) ? "" : "not ", "ok 35\n"; -print +($h{'c'} == 3) ? "" : "not ", "ok 36\n"; +print +($h{'a'} == 1) ? "" : "not ", "ok 32\n"; +print +($h{'b'} == 2) ? "" : "not ", "ok 33\n"; +print +($h{'c'} == 3) ? "" : "not ", "ok 34\n"; + +# check for scope leakage +$a = 'outer'; +if (1) { local $a = 'inner' } +print +($a eq 'outer') ? "" : "not ", "ok 35\n"; + +# see if localization works when scope unwinds +local $m = 5; +eval { + for $m (6) { + local $m = 7; + die "bye"; + } +}; +print $m == 5 ? "" : "not ", "ok 36\n";