From: Vincent Pit Date: Mon, 16 Aug 2010 15:21:17 +0000 (+0200) Subject: More quotelike environments testing X-Git-Tag: v0.22~2 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=commitdiff_plain;h=168f6fe27525f9fa5bd50b032e1e601b506abb16 More quotelike environments testing --- diff --git a/t/20-good.t b/t/20-good.t index 12a4a76..85f1900 100644 --- a/t/20-good.t +++ b/t/20-good.t @@ -9,7 +9,7 @@ package main; use strict; use warnings; -use Test::More tests => 74 * 8; +use Test::More tests => 86 * 8; BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} } @@ -240,6 +240,30 @@ $obj = "apple @{[$x->$meth]} pear" $obj = "apple ${\($y->$meth)} pear" #### $obj = "apple @{[$y->$meth]} pear" +#### # local $_ = "foo"; +s/foo/return; Hlagh->new/e; +#### # local $_ = "bar"; +s/foo/return; Hlagh->new/e; +#### # local $_ = "foo"; +s/foo/return; Hlagh->$cb/e; +#### # local $_ = "bar"; +s/foo/return; Hlagh->$cb/e; +#### # local $_ = "foo"; +s/foo/return; Hlagh->$meth/e; +#### # local $_ = "bar"; +s/foo/return; Hlagh->$meth/e; +#### # local $_ = "foo"; +s/foo/return; $pkg->new/e; +#### # local $_ = "bar"; +s/foo/return; $pkg->new/e; +#### # local $_ = "foo"; +s/foo/return; $pkg->$cb/e; +#### # local $_ = "bar"; +s/foo/return; $pkg->$cb/e; +#### # local $_ = "foo"; +s/foo/return; $pkg->$meth/e; +#### # local $_ = "bar"; +s/foo/return; $pkg->$meth/e; #### exec $x $x, @a; #### diff --git a/t/21-bad.t b/t/21-bad.t index 09157e9..abdd7d3 100644 --- a/t/21-bad.t +++ b/t/21-bad.t @@ -11,8 +11,8 @@ use warnings; my ($tests, $reports); BEGIN { - $tests = 70; - $reports = 82; + $tests = 76; + $reports = 88; } use Test::More tests => 3 * (4 * $tests + $reports) + 4; @@ -402,6 +402,30 @@ $obj = "apple ${\(new $x qq|${\(stuff $y)}|)} pear" $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 { }; ----