]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blobdiff - t/20-methods/stash.t
Order the test subdirectories
[perl/modules/re-engine-Plugin.git] / t / 20-methods / stash.t
diff --git a/t/20-methods/stash.t b/t/20-methods/stash.t
new file mode 100644 (file)
index 0000000..9083263
--- /dev/null
@@ -0,0 +1,31 @@
+=pod
+
+Test the C<stash> method
+
+=cut
+
+use strict;
+use Test::More tests => 5;
+
+use re::engine::Plugin (
+    comp => sub {
+        my ($re) = @_;
+
+        my $sv = [ qw( a o e u ) ];
+
+        $re->stash( $sv );
+    },
+    exec => sub {
+        my ($re, $str) = @_;
+
+        my $stash = $re->stash;
+        my $ret = $re->stash( $stash );
+        ok(!$ret, "stash returns no value on assignment");
+        my %h = qw( 0 a 1 o 2 e 3 u );
+        for (keys %h) {
+            is($h{$_}, $stash->[$_]);
+        }
+    }
+);
+
+"ook" =~ /eek/;