summaryrefslogtreecommitdiff
path: root/t/cmd
diff options
context:
space:
mode:
authorM. J. T. Guy <mjtg@cus.cam.ac.uk>1998-07-30 13:18:15 +0100
committerGurusamy Sarathy <gsar@cpan.org>1998-08-02 06:37:06 +0000
commit19a09eb8fc52598025e90f4c4f688a3db0626154 (patch)
treedec4ae33a6e3b23d148bb44392f53528c35b7a4b /t/cmd
parentaf819cba4f44bf2074ec4808e403dedf8c3ce2b2 (diff)
downloadperl-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-xt/cmd/subval.t9
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";