]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blobdiff - t/import.t
Importing re-engine-Plugin-0.02.tar.gz
[perl/modules/re-engine-Plugin.git] / t / import.t
index 04cb7f2b83a669d51d680affed74a4e7764c10b3..f2eae227478ae36e455f2ba9abed3a4b24ccb262 100644 (file)
@@ -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";