]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/21-bad.t
Handle __PACKAGE__ as object name correctly
[perl/modules/indirect.git] / t / 21-bad.t
index 5984ef03ba031984995b00508c9d464162b7ba57..0d3b48d96a3f81abe21a73e361595fc19e387381 100644 (file)
@@ -11,8 +11,8 @@ use warnings;
 
 my ($tests, $reports);
 BEGIN {
- $tests   = 82;
- $reports = 94;
+ $tests   = 84;
+ $reports = 96;
 }
 
 use Test::More tests => 3 * (4 * $tests + $reports) + 4;
@@ -101,7 +101,7 @@ SKIP:
 SKIP:
    {
     skip 'No space tests on perl 5.11' => 4 + @expected
-                                                  if $] >= 5.011 and $] < 5.012;
+                                              if "$]" >= 5.011 and "$]" < 5.012;
     my $code = $code;
     $code =~ s/\$/\$ \n\t /g;
 
@@ -219,7 +219,7 @@ $obj = new $x qr{foo\s+bar}, 1 .. 1;
 ----
 [ 'new', '$x' ]
 ####
-$obj = new $x(qw/bar baz/);
+$obj = new $x(qw<bar baz>);
 ----
 [ 'new', '$x' ]
 ####
@@ -280,15 +280,15 @@ meh $y 1, 2;
 meh $y, 1, 2;
 ----
 [ 'meh', '$y' ]
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
 meh $z;
 ----
 [ 'meh', '$z' ]
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
 meh $z 1, 2;
 ----
 [ 'meh', '$z' ]
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
 meh $z, 1, 2;
 ----
 [ 'meh', '$z' ]
@@ -491,3 +491,13 @@ meh { feh $x; 1; } new Hlagh, feh $y;
 $obj = "apple @{[new { feh $x; meh $y; 1 }]} pear"
 ----
 [ 'feh', '$x' ], [ 'meh', '$y' ], [ 'new', '{' ]
+####
+package __PACKAGE_;
+new __PACKAGE_;
+----
+[ 'new', '__PACKAGE_' ]
+####
+package __PACKAGE___;
+new __PACKAGE___;
+----
+[ 'new', '__PACKAGE___' ]