]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blobdiff - t/import.t
Put all tests into a subdirectory
[perl/modules/re-engine-Plugin.git] / t / import.t
diff --git a/t/import.t b/t/import.t
deleted file mode 100644 (file)
index f2eae22..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-=pod
-
-Test that lexical importing works, check BEGIN-ish stuff etc.
-
-=cut
-
-use strict;
-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(
-        exec => sub { $_[0]->pattern eq $_[1] }
-    );
-}
-
-ok "^hello" =~ /^hello/ => "regex modified to match a literal pattern";
-
-{
-    BEGIN {
-        re::engine::Plugin->import(
-            exec => sub { $_[0]->pattern ne $_[1] }
-        );
-    }
-
-    ok "^hello" !~ /^hello/ => "regex modified not to match a literal pattern";
-    {
-        BEGIN {
-            re::engine::Plugin->import(
-                exec => sub { $_[0]->pattern eq '^[abc]$' }
-            );
-        }
-        ok "whatever" =~ /^[abc]$/ => "regex modified to match some exact nonsense";
-        BEGIN { re::engine::Plugin->unimport };
-        ok "whatever" !~ /^[abc]$/ => "regex modified to match some exact nonsense unimported";
-    }
-    ok "^hello" !~ /^hello/ => "regex modified not 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";