diff options
author | Yitzchak Scott-Thoennes <sthoenna@efn.org> | 2002-09-04 14:09:01 -0700 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-09-08 14:55:31 +0000 |
commit | 446eaa427e017001f2d47e21b0ad20ce965cd808 (patch) | |
tree | 166db7147f95e45ee8ab9812c7dc842373b673ec /lib/overload.t | |
parent | eb25aaf601be63900e7fddecbca6277c850b9e70 (diff) | |
download | perl-446eaa427e017001f2d47e21b0ad20ce965cd808.tar.gz |
sv_2pv_flags and ROK and UTF8 flags
Date: Wed, 04 Sep 2002 21:09:01 -0700
Message-ID: <djtd9gzkgyLd092yn@efn.org>
Date: Fri, 06 Sep 2002 09:23:03 -0700
Message-ID: <nZNe9gzkgKdH092yn@efn.org>
p4raw-id: //depot/perl@17864
Diffstat (limited to 'lib/overload.t')
-rw-r--r-- | lib/overload.t | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/overload.t b/lib/overload.t index 4db647dbee..0798a91b9f 100644 --- a/lib/overload.t +++ b/lib/overload.t @@ -41,7 +41,7 @@ sub numify { 0 + "${$_[0]}" } # Not needed, additional overhead package main; -$test = 0; +our $test = 0; $| = 1; print "1..",&last,"\n"; @@ -1064,9 +1064,10 @@ package main; my $utfvar = new utf8_o 200.2.1; -test("$utfvar" eq 200.2.1); # 223 +test("$utfvar" eq 200.2.1); # 223 - stringify +test("a$utfvar" eq "a".200.2.1); # 224 - overload via sv_2pv_flags -# 224..226 -- more %{} tests. Hangs in 5.6.0, okay in later releases. +# 225..227 -- more %{} tests. Hangs in 5.6.0, okay in later releases. # Basically this example implements strong encapsulation: if Hderef::import() # were to eval the overload code in the caller's namespace, the privatisation # would be quite transparent. @@ -1080,9 +1081,9 @@ sub xet { @_ == 2 ? $_[0]->{$_[1]} : package main; my $a = Foo->new; $a->xet('b', 42); -print $a->xet('b') == 42 ? "ok 224\n" : "not ok 224\n"; -print defined eval { $a->{b} } ? "not ok 225\n" : "ok 225\n"; -print $@ =~ /zap/ ? "ok 226\n" : "not ok 226\n"; +print $a->xet('b') == 42 ? "ok 225\n" : "not ok 225\n"; +print defined eval { $a->{b} } ? "not ok 226\n" : "ok 226\n"; +print $@ =~ /zap/ ? "ok 227\n" : "not ok 227\n"; # Last test is: -sub last {226} +sub last {227} |