]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blobdiff - t/methods.t
Importing re-engine-Plugin-0.02.tar.gz
[perl/modules/re-engine-Plugin.git] / t / methods.t
index 56de9478925ea612544c50d98db22d8115514fab..6df32fa1a01a20bd756d1b555abae727f74832ee 100644 (file)
@@ -8,7 +8,7 @@ use strict;
 
 use feature ':5.10';
 
-use Test::More 'no_plan';#tests => 6;
+use Test::More tests => 9;
 
 use re::engine::Plugin (
     comp => sub  {
@@ -27,11 +27,11 @@ use re::engine::Plugin (
         # pattern
         cmp_ok($re->pattern, 'eq', ' foobar zoobar ' => '->pattern ok');
 
-        # flags
-        my $f = $re->flags;
-        like $f, qr/i/, 'str flags /i';
-        like $f, qr/x/, 'str flags /x';
-        like $f, qr/^[cgimosx]+$/, 'flags contain all-good characters';
+        # modifiers
+        my %mod = $re->mod;
+        ok(exists $mod{i}, 'str flags /i');
+        ok(exists $mod{x}, 'str flags /i');
+        like(join('', keys %mod), qr/^[cgimosx]+$/, 'flags contain all-good characters');
 
         # stash
         cmp_ok($re->stash->{"x"}, '==', 5, "data correct in stash");
@@ -39,14 +39,6 @@ use re::engine::Plugin (
         cmp_ok(ref $re->stash->{"y"}, 'eq', 'CODE', "data correct in stash");
         cmp_ok($re->stash->{"y"}->(), '==', 6, "data correct in stash");
 
-        # This needs a less sucky name
-        #
-        # Pattern: ' foobar zoobar ', set $1 to "foobar" (if I counted this right:)
-#        $re->offset_captures( [1, 7], ... ); 
-
-        # This name sucks as well
-#        $re->named_captures2offset_captures( myNameIs => 0 ): # $+{myNameIs} = $1
-
         # Pattern contains "foo", "bar" and "zoo", return a true
         return $re->pattern =~ /zoo/;
     }