diff options
author | doy <doy@tozt.net> | 2008-12-06 23:11:06 -0500 |
---|---|---|
committer | doy <doy@tozt.net> | 2008-12-06 23:11:06 -0500 |
commit | fe814d63a053867c38e9b22c449475ea1573f02e (patch) | |
tree | b91941f2af415ed8c3e63e2bc666e830221dfbcf /t | |
parent | 108c4ab3669e263875df3fb68dc8e2edf7783ef2 (diff) | |
download | moosex-role-matcher-fe814d63a053867c38e9b22c449475ea1573f02e.tar.gz moosex-role-matcher-fe814d63a053867c38e9b22c449475ea1573f02e.zip |
add all_match
Diffstat (limited to 't')
-rw-r--r-- | t/100-collection.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/100-collection.t b/t/100-collection.t index ed360fe..02b1a61 100644 --- a/t/100-collection.t +++ b/t/100-collection.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 3; +use Test::More tests => 4; use Test::Deep; package Foo; @@ -33,6 +33,11 @@ sub any_match { Foo->any_match($self->foos, @_); } +sub all_match { + my $self = shift; + Foo->all_match($self->foos, @_); +} + sub grep_matches { my $self = shift; Foo->grep_matches($self->foos, @_); @@ -50,5 +55,7 @@ is($foos->first_match(a => ''), $foo2, 'first_match works'); ok(!$foos->any_match(b => qr/z/), 'any_match works'); +ok($foos->all_match(c => qr/[^bf]/), + 'all_match works'); cmp_deeply([$foos->grep_matches(c => qr/o/)], set(shallow($foo2), shallow($foo3)), 'grep_matches works'); |