]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blob - t/20-methods/stash.t
9083263566071642d0583946bde5707f4f3efbd6
[perl/modules/re-engine-Plugin.git] / t / 20-methods / stash.t
1 =pod
2
3 Test the C<stash> method
4
5 =cut
6
7 use strict;
8 use Test::More tests => 5;
9
10 use re::engine::Plugin (
11     comp => sub {
12         my ($re) = @_;
13
14         my $sv = [ qw( a o e u ) ];
15
16         $re->stash( $sv );
17     },
18     exec => sub {
19         my ($re, $str) = @_;
20
21         my $stash = $re->stash;
22         my $ret = $re->stash( $stash );
23         ok(!$ret, "stash returns no value on assignment");
24         my %h = qw( 0 a 1 o 2 e 3 u );
25         for (keys %h) {
26             is($h{$_}, $stash->[$_]);
27         }
28     }
29 );
30
31 "ook" =~ /eek/;