diff options
author | M. J. T. Guy <mjtg@cus.cam.ac.uk> | 1998-07-30 13:18:15 +0100 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-08-02 06:37:06 +0000 |
commit | 19a09eb8fc52598025e90f4c4f688a3db0626154 (patch) | |
tree | dec4ae33a6e3b23d148bb44392f53528c35b7a4b /t/cmd | |
parent | af819cba4f44bf2074ec4808e403dedf8c3ce2b2 (diff) | |
download | perl-19a09eb8fc52598025e90f4c4f688a3db0626154.tar.gz |
add test for magic autovivification
Message-Id: <E0z1qit-0003O5-00@taurus.cus.cam.ac.uk>
Subject: Re: Perl5.005_01 failing to autovivify subroutine args
p4raw-id: //depot/maint-5.005/perl@1704
Diffstat (limited to 't/cmd')
-rwxr-xr-x | t/cmd/subval.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/cmd/subval.t b/t/cmd/subval.t index 3c1ffb89ea..3c60690ebf 100755 --- a/t/cmd/subval.t +++ b/t/cmd/subval.t @@ -33,7 +33,7 @@ sub foo6 { 'true2' unless $_[0]; } -print "1..34\n"; +print "1..36\n"; if (&foo1(0) eq '0') {print "ok 1\n";} else {print "not ok 1 $foo\n";} if (&foo1(1) eq 'true2') {print "ok 2\n";} else {print "not ok 2\n";} @@ -177,3 +177,10 @@ sub iseof { eof UNIQ ? print "not ok $main'i\n" : print "ok $main'i\n"; } } + +sub autov { $_[0] = 23 }; + +my $href = {}; +print keys %$href ? 'not ' : '', "ok 35\n"; +autov($href->{b}); +print join(':', %$href) eq 'b:23' ? '' : 'not ', "ok 36\n"; |