X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F21-bad.t;h=abdd7d3e54f8fe10429a6b285841f91c6f589e4f;hp=f4231d72ae1517d3a23fd2c7e1f3186c8ff35126;hb=168f6fe27525f9fa5bd50b032e1e601b506abb16;hpb=e11d9a3efc1dcc5648202bd7651a982477bbc587 diff --git a/t/21-bad.t b/t/21-bad.t index f4231d7..abdd7d3 100644 --- a/t/21-bad.t +++ b/t/21-bad.t @@ -11,8 +11,8 @@ use warnings; my ($tests, $reports); BEGIN { - $tests = 61; - $reports = 69; + $tests = 76; + $reports = 88; } use Test::More tests => 3 * (4 * $tests + $reports) + 4; @@ -98,7 +98,10 @@ SKIP: } } +SKIP: { + skip 'No space tests on perl 5.11' => 4 + @expected + if $] >= 5.011 and $] < 5.012; my $code = $code; $code =~ s/\$/\$ \n\t /g; @@ -368,6 +371,62 @@ Hlagh->new(meh $x) ---- [ 'meh', '$x' ] #### +$obj = "apple ${\(new Hlagh)} pear" +---- +[ 'new', 'Hlagh' ] +#### +$obj = "apple @{[new Hlagh]} pear" +---- +[ 'new', 'Hlagh' ] +#### +$obj = "apple ${\(new $x)} pear" +---- +[ 'new', '$x' ] +#### +$obj = "apple @{[new $x]} pear" +---- +[ 'new', '$x' ] +#### +$obj = "apple ${\(new $y)} pear" +---- +[ 'new', '$y' ] +#### +$obj = "apple @{[new $y]} pear" +---- +[ 'new', '$y' ] +#### +$obj = "apple ${\(new $x qq|${\(stuff $y)}|)} pear" +---- +[ 'stuff', '$y' ], [ 'new', '$x' ] +#### +$obj = "apple @{[new $x qq|@{[stuff $y]}|]} pear" +---- +[ 'stuff', '$y' ], [ 'new', '$x' ] +#### # local $_ = "foo"; +s/foo/return; new Hlagh/e; +---- +[ 'new', 'Hlagh' ] +#### # local $_ = "bar"; +s/foo/return; new Hlagh/e; +---- +[ 'new', 'Hlagh' ] +#### # local $_ = "foo"; +s/foo/return; new $x/e; +---- +[ 'new', '$x' ] +#### # local $_ = "bar"; +s/foo/return; new $x/e; +---- +[ 'new', '$x' ] +#### # local $_ = "foo"; +s/foo/return; new $y/e; +---- +[ 'new', '$y' ] +#### # local $_ = "bar"; +s/foo/return; new $y/e; +---- +[ 'new', '$y' ] +#### meh { }; ---- [ 'meh', '{' ] @@ -404,3 +463,7 @@ meh { feh $y; 1; }; meh { feh $x; 1; } new Hlagh, feh $y; ---- [ 'feh', '$x' ], [ 'new', 'Hlagh' ], [ 'feh', '$y' ], [ 'meh', '{' ] +#### +$obj = "apple @{[new { feh $x; meh $y; 1 }]} pear" +---- +[ 'feh', '$x' ], [ 'meh', '$y' ], [ 'new', '{' ]