X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Fre-engine-Plugin.git;a=blobdiff_plain;f=t%2Fimport.t;h=f2eae227478ae36e455f2ba9abed3a4b24ccb262;hp=04cb7f2b83a669d51d680affed74a4e7764c10b3;hb=2dd7bc5f80da4fe2220e28de1102641c239d084c;hpb=def98fc0d7f5e9527b28af6b90d4ddb07fbc845c diff --git a/t/import.t b/t/import.t index 04cb7f2..f2eae22 100644 --- a/t/import.t +++ b/t/import.t @@ -5,18 +5,13 @@ Test that lexical importing works, check BEGIN-ish stuff etc. =cut use strict; - -use Data::Dumper; - -use Test::More tests => 7; - +use Test::More tests => 8; use re::engine::Plugin (); like "a", qr/^a$/, "import didn't run, perl's regex engine in effect"; BEGIN { re::engine::Plugin->import( - comp => sub {}, # TODO: remove when this can be omitted exec => sub { $_[0]->pattern eq $_[1] } ); } @@ -26,7 +21,6 @@ ok "^hello" =~ /^hello/ => "regex modified to match a literal pattern"; { BEGIN { re::engine::Plugin->import( - comp => sub {}, # TODO: remove when this can be omitted exec => sub { $_[0]->pattern ne $_[1] } ); } @@ -35,7 +29,6 @@ ok "^hello" =~ /^hello/ => "regex modified to match a literal pattern"; { BEGIN { re::engine::Plugin->import( - comp => sub {}, # TODO: remove when this can be omitted exec => sub { $_[0]->pattern eq '^[abc]$' } ); } @@ -48,15 +41,11 @@ ok "^hello" =~ /^hello/ => "regex modified to match a literal pattern"; ok "^hello" =~ /^hello/ => "regex modified to match a literal pattern"; +# Another import at the same scope +BEGIN { + re::engine::Plugin->import( + exec => sub { $_[0]->pattern ne $_[1] } + ); +} - - - - - - - - - - - +ok "^hello" !~ /^hello/ => "regex modified not to match a literal pattern";