diff options
author | 2000-04-30 04:35:52 +0000 | |
---|---|---|
committer | 2000-04-30 04:35:52 +0000 | |
commit | f0cd00d0a72778a1f743fc658e7e04d31e83231e (patch) | |
tree | 63475e53940de5f40443d58bf320b2a38861e1e3 | |
parent | misc header reordering, remove #undef of relocation_info (diff) | |
download | wireguard-openbsd-f0cd00d0a72778a1f743fc658e7e04d31e83231e.tar.xz wireguard-openbsd-f0cd00d0a72778a1f743fc658e7e04d31e83231e.zip |
Perl Change 5912 by gsar@auger on 2000/04/24 04:17:15
fix totally broken caching in UNIVERSAL::isa() (from Nick Ing-Simmons);
fixes problems with 5.6.0 and Tk.
-rw-r--r-- | gnu/usr.bin/perl/t/op/universal.t | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/gnu/usr.bin/perl/t/op/universal.t b/gnu/usr.bin/perl/t/op/universal.t index a6bd03dbe92..a0a74ec4b2a 100644 --- a/gnu/usr.bin/perl/t/op/universal.t +++ b/gnu/usr.bin/perl/t/op/universal.t @@ -6,9 +6,10 @@ BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib' if -d '../lib'; + $| = 1; } -print "1..73\n"; +print "1..80\n"; $a = {}; bless $a, "Bob"; @@ -28,6 +29,19 @@ sub new { bless {} } $Alice::VERSION = 2.718; +{ + package Cedric; + our @ISA; + use base qw(Human); +} + +{ + package Programmer; + our $VERSION = 1.667; + + sub write_perl { 1 } +} + package main; my $i = 2; @@ -45,12 +59,34 @@ test $a->isa("Human"); test ! $a->isa("Male"); +test ! $a->isa('Programmer'); + test $a->can("drink"); test $a->can("eat"); test ! $a->can("sleep"); +test (!Cedric->isa('Programmer')); + +test (Cedric->isa('Human')); + +push(@Cedric::ISA,'Programmer'); + +test (Cedric->isa('Programmer')); + +{ + package Alice; + base::->import('Programmer'); +} + +test $a->isa('Programmer'); +test $a->isa("Female"); + +@Cedric::ISA = qw(Bob); + +test (!Cedric->isa('Programmer')); + my $b = 'abc'; my @refs = qw(SCALAR SCALAR LVALUE GLOB ARRAY HASH CODE); my @vals = ( \$b, \3.14, \substr($b,1,1), \*b, [], {}, sub {} ); @@ -88,7 +124,7 @@ eval "use UNIVERSAL"; test $a->isa("UNIVERSAL"); -my $sub2 = join ' ', sort grep { defined &{"UNIVERSAL::$_"} } keys %UNIVERSAL::; +my $sub2 = join ' ', sort grep { defined &{"UNIVERSAL::$_"} } keys %UNIVERSAL::; # XXX import being here is really a bug if ('a' lt 'A') { test $sub2 eq "can import isa VERSION"; |