summaryrefslogtreecommitdiff
path: root/t/comp
diff options
context:
space:
mode:
authorAlex Vandiver <alexmv@mit.edu>2003-05-02 02:45:05 -0400
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-05-12 21:49:21 +0000
commite27ad1f20b87bf08f3461d0be498f8d4da22a576 (patch)
treec42d11b1dcf1a112af0ecb9f209acb0f8b67e145 /t/comp
parentf9738a7f833dee4b6953b05d93d3f222f78be370 (diff)
downloadperl-e27ad1f20b87bf08f3461d0be498f8d4da22a576.tar.gz
Re: Bug stomping fun. [PATCH: bug #1016]
Message-Id: <1051872303.26203.104.camel@supox> (plus perldiag nit) p4raw-id: //depot/perl@19505
Diffstat (limited to 't/comp')
-rwxr-xr-xt/comp/package.t23
1 files changed, 20 insertions, 3 deletions
diff --git a/t/comp/package.t b/t/comp/package.t
index 4982256db7..6781be4b4f 100755
--- a/t/comp/package.t
+++ b/t/comp/package.t
@@ -1,12 +1,14 @@
#!./perl
-print "1..8\n";
+print "1..12\n";
$blurfl = 123;
$foo = 3;
package xyz;
+sub new {bless [];}
+
$bar = 4;
{
@@ -24,9 +26,9 @@ $xyz = join(':', sort(keys %xyz::));
$ABC = join(':', sort(keys %ABC::));
if ('a' lt 'A') {
- print $xyz eq 'bar:main:xyz:ABC' ? "ok 1\n" : "not ok 1 '$xyz'\n";
+ print $xyz eq 'bar:main:new:xyz:ABC' ? "ok 1\n" : "not ok 1 '$xyz'\n";
} else {
- print $xyz eq 'ABC:bar:main:xyz' ? "ok 1\n" : "not ok 1 '$xyz'\n";
+ print $xyz eq 'ABC:bar:main:new:xyz' ? "ok 1\n" : "not ok 1 '$xyz'\n";
}
print $ABC eq 'blurfl:dyick' ? "ok 2\n" : "not ok 2 '$ABC'\n";
print $main'blurfl == 123 ? "ok 3\n" : "not ok 3\n";
@@ -51,3 +53,18 @@ sub foo {
}
print((foo(1))[0] eq 'PQR' ? "ok 8\n" : "not ok 8\n");
+
+my $Q = xyz->new();
+undef %xyz::;
+eval { $a = *xyz::new{PACKAGE}; };
+print $a eq "__ANON__" ? "ok 9\n" : "not ok 9\n";
+
+eval { $Q->param; };
+print $@ =~ /^Can't use anonymous symbol table for method lookup/ ?
+ "ok 10\n" : "not ok 10\n";
+
+print "$Q" =~ /^__ANON__=/ ? "ok 11\n" : "not ok 11\n";
+
+print ref $Q eq "__ANON__" ? "ok 12\n" : "not ok 12\n";
+
+