diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-05-14 10:53:55 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-05-14 10:53:55 +0000 |
commit | 8cee197f4fc867621357445fae7d37a580273f7e (patch) | |
tree | afa7181c847061200a7323363f84fe42102c2aa3 /t | |
parent | fcf1a26259cd7fd60001fdf43deb8ce50f4a974d (diff) | |
download | perl-8cee197f4fc867621357445fae7d37a580273f7e.tar.gz |
[win32] merge change#896 from maintbranch
p4raw-link: @896 on //depot/maint-5.004/perl: 0562b9ae2b0eff79632fc0164c13c34c06a019e2
p4raw-id: //depot/win32/perl@938
Diffstat (limited to 't')
-rwxr-xr-x | t/op/gv.t | 20 | ||||
-rwxr-xr-x | t/op/misc.t | 5 | ||||
-rwxr-xr-x | t/op/pack.t | 8 |
3 files changed, 31 insertions, 2 deletions
@@ -4,7 +4,7 @@ # various typeglob tests # -print "1..13\n"; +print "1..18\n"; # type coersion on assignment $foo = 'foo'; @@ -65,3 +65,21 @@ if (defined $baa) { { package Foo::Bar } print exists $Foo::{'Bar::'} ? "ok 12\n" : "not ok 12\n"; print $Foo::{'Bar::'} eq '*Foo::Bar::' ? "ok 13\n" : "not ok 13\n"; + +# test undef operator clearing out entire glob +$foo = 'stuff'; +@foo = qw(more stuff); +%foo = qw(even more random stuff); +undef *foo; +print +($foo || @foo || %foo) ? "not ok" : "ok", " 16\n"; + +# test warnings from assignment of undef to glob +{ + my $msg; + local $SIG{__WARN__} = sub { $msg = $_[0] }; + local $^W = 1; + *foo = 'bar'; + print $msg ? "not ok" : "ok", " 17\n"; + *foo = undef; + print $msg ? "ok" : "not ok", " 18\n"; +} diff --git a/t/op/misc.t b/t/op/misc.t index 582ffa7905..9ab6831859 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -368,6 +368,11 @@ EXPECT 1 2 ######## +-w +sub testme { my $a = "test"; { local $a = "new test"; print $a }} +EXPECT +Can't localize lexical variable $a at - line 2. +######## package X; sub ascalar { my $r; bless \$r } sub DESTROY { print "destroyed\n" }; diff --git a/t/op/pack.t b/t/op/pack.t index f9a89a3ec0..de5fcff218 100755 --- a/t/op/pack.t +++ b/t/op/pack.t @@ -2,7 +2,7 @@ # $RCSfile: pack.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:11 $ -print "1..29\n"; +print "1..30\n"; $format = "c2 x5 C C x s d i l a6"; # Need the expression in here to force ary[5] to be numeric. This avoids @@ -100,3 +100,9 @@ sub foo { my $a = "a"; return $a . $a++ . $a++ } # undef should give null pointer print((pack("p", undef) =~ /^\0+/ ? "ok " : "not ok "),$test++,"\n"); +# Check for optimizer bug (e.g. Digital Unix GEM cc with -O4 on DU V4.0B gives +# 4294967295 instead of -1) +# see #ifdef __osf__ in pp.c pp_unpack +# Test 30: +print( ((unpack("i",pack("i",-1))) == -1 ? "ok " : "not ok "),$test++,"\n"); + |