diff options
author | Simon Cozens <simon@netthink.co.uk> | 2000-12-27 14:12:44 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-28 22:37:45 +0000 |
commit | b9159b79065e18cce8202d1aa248ae5ae5f811e4 (patch) | |
tree | 8bbec927d4422331c4ad492ac366b541d861526d /t | |
parent | 7998bf78b57426b34c1c60a8c6704d9016b44dcd (diff) | |
download | perl-b9159b79065e18cce8202d1aa248ae5ae5f811e4.tar.gz |
Re: [ID 19991001.003] sort(sub(arg)) misparsed as sort sub args
Message-ID: <20001227141244.A13344@deep-dark-truthful-mirror.perlhacker.org>
p4raw-id: //depot/perl@8239
Diffstat (limited to 't')
-rwxr-xr-x | t/op/method.t | 7 | ||||
-rwxr-xr-x | t/op/sort.t | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/t/op/method.t b/t/op/method.t index be4df75fe2..1f5cbb64dc 100755 --- a/t/op/method.t +++ b/t/op/method.t @@ -9,7 +9,7 @@ BEGIN { @INC = '../lib'; } -print "1..53\n"; +print "1..54\n"; @A::ISA = 'B'; @B::ISA = 'C'; @@ -185,3 +185,8 @@ test(do { eval 'E->foo()'; test(do { eval '$e = bless {}, "E"; $e->foo()'; $@ =~ /^\QCan't locate object method "foo" via package "E" (perhaps / ? 1 : $@}, 1); +# This is actually testing parsing of indirect objects and undefined subs +# print foo("bar") where foo does not exist is not an indirect object. +# print foo "bar" where foo does not exist is an indirect object. +eval { sub AUTOLOAD { "ok ", shift, "\n"; } }; +print nonsuch(++$cnt); diff --git a/t/op/sort.t b/t/op/sort.t index 9095871a29..c1dfb63ccb 100755 --- a/t/op/sort.t +++ b/t/op/sort.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } use warnings; -print "1..57\n"; +print "1..58\n"; # XXX known to leak scalars { @@ -321,3 +321,10 @@ sub cxt_six { sort test_if_scalar 1,2 } print "# x = '@b'\n"; print !$def ? "ok 57\n" : "not ok 57\n"; } + +# Bug 19991001.003 +{ + sub routine { "one", "two" }; + @a = sort(routine(1)); + print "@a" eq "one two" ? "ok 58\n" : "not ok 58\n"; +} |