diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-11-04 14:11:26 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-06 01:13:48 -0700 |
commit | 60d6334874c6f82066ad72b36a86bcb753de82a2 (patch) | |
tree | f84c98df51148a83467bec30f03524fa644e1b12 /ext/XS-APItest | |
parent | 233fb8229a314d457fa1db70bbe741ee5f985290 (diff) | |
download | perl-60d6334874c6f82066ad72b36a86bcb753de82a2.tar.gz |
Make source filters work in evalbytes
When a filter is added, the current buffer is hung on the end of
the filters array, and a new substring of it becomes the current
buffer.
Diffstat (limited to 'ext/XS-APItest')
-rw-r--r-- | ext/XS-APItest/t/eval-filter.t | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ext/XS-APItest/t/eval-filter.t b/ext/XS-APItest/t/eval-filter.t index d4a9153613..f54bd83707 100644 --- a/ext/XS-APItest/t/eval-filter.t +++ b/ext/XS-APItest/t/eval-filter.t @@ -1,16 +1,25 @@ #!perl -w use strict; -use Test::More tests => 3; +use Test::More tests => 5; use XS::APItest; { use feature "unicode_eval"; my $unfiltered_foo = "foo"; - eval "BEGIN { filter() }"; - like $@, qr/^Source filters apply only to byte streams at /, + BEGIN { + eval "BEGIN { filter() }"; + like $@, qr/^Source filters apply only to byte streams at /, 'filters die under unicode_eval'; + } is "foo", $unfiltered_foo, 'filters leak not out of unicode evals'; + + use feature "evalbytes"; + our $thingy; + BEGIN { evalbytes "BEGIN { filter() }\n\$thingy = 'foo'" } + is $thingy, "fee", + "source filters apply to evalbytten strings"; + is "foo", $unfiltered_foo, 'filters leak not out of byte evals'; } BEGIN { eval "BEGIN{ filter() }" } |