From: Vincent Pit Date: Mon, 4 Aug 2008 21:10:41 +0000 (+0200) Subject: We can't guess how many elements a match will return X-Git-Tag: v0.02~20 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=1a31caf5f555fb5f0b63ac682c7ea4b542282186;p=perl%2Fmodules%2FSub-Nary.git We can't guess how many elements a match will return --- diff --git a/lib/Sub/Nary.pm b/lib/Sub/Nary.pm index 18d4223..f408f8c 100644 --- a/lib/Sub/Nary.pm +++ b/lib/Sub/Nary.pm @@ -202,7 +202,7 @@ $ops{$_} = 0 for qw/stub nextstate/; $ops{$_} = 1 for qw/padsv/; $ops{$_} = 'list' for qw/padav/; $ops{$_} = 'list' for qw/padhv rv2hv/; -$ops{$_} = 'list' for qw/padany flip/; +$ops{$_} = 'list' for qw/padany flip match/; sub enter { my ($self, $cv) = @_; diff --git a/t/21-list.t b/t/21-list.t index cb1dd1a..71edefb 100644 --- a/t/21-list.t +++ b/t/21-list.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 27; +use Test::More tests => 28; use Sub::Nary; @@ -41,6 +41,8 @@ my @tests = ( [ sub { 1 .. 3 }, 'list' ], [ sub { my @a = (1 .. 4) }, 4 ], + [ sub { "banana" =~ /(a)/g }, 'list' ], + [ sub { (localtime)[0, 1, 2] }, 3 ], [ sub { for (1, 2, 3) { } }, 0 ],