diff options
author | markm <markm@FreeBSD.org> | 2000-06-25 11:04:01 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2000-06-25 11:04:01 +0000 |
commit | 2618fad5bbb2d0182eb31ed805c41b543c513940 (patch) | |
tree | 52ba93338b13aefd02a0055304a9eccfa0e049f5 /contrib/perl5/t/op/hashwarn.t | |
parent | 77644ee620b6a79cf8c538abaf7cd301a875528d (diff) | |
download | FreeBSD-src-2618fad5bbb2d0182eb31ed805c41b543c513940.zip FreeBSD-src-2618fad5bbb2d0182eb31ed805c41b543c513940.tar.gz |
Vendor import of Perl 5.006
Diffstat (limited to 'contrib/perl5/t/op/hashwarn.t')
-rwxr-xr-x | contrib/perl5/t/op/hashwarn.t | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/contrib/perl5/t/op/hashwarn.t b/contrib/perl5/t/op/hashwarn.t index 6343a2a..9182273 100755 --- a/contrib/perl5/t/op/hashwarn.t +++ b/contrib/perl5/t/op/hashwarn.t @@ -2,19 +2,18 @@ BEGIN { chdir 't' if -d 't'; - @INC = '../lib'; + unshift @INC, '../lib'; } use strict; +use warnings; use vars qw{ @warnings }; BEGIN { - $^W |= 1; # Insist upon warnings - # ...and save 'em as we go $SIG{'__WARN__'} = sub { push @warnings, @_ }; $| = 1; - print "1..7\n"; + print "1..9\n"; } END { print "not ok\n# Uncaught warnings:\n@warnings\n" if @warnings } @@ -66,6 +65,13 @@ my $ref_msg = '/^Reference found where even-sized list expected/'; %hash = sub { print "ok" }; test_warning 6, shift @warnings, $odd_msg; + my $avhv = [{x=>1,y=>2}]; + %$avhv = (x=>13,'y'); + test_warning 7, shift @warnings, $odd_msg; + + %$avhv = 'x'; + test_warning 8, shift @warnings, $odd_msg; + $_ = { 1..10 }; - test 7, ! @warnings, "Unexpected warning"; + test 9, ! @warnings, "Unexpected warning"; } |