From fe814d63a053867c38e9b22c449475ea1573f02e Mon Sep 17 00:00:00 2001 From: doy Date: Sat, 6 Dec 2008 23:11:06 -0500 Subject: add all_match --- t/100-collection.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 't') 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'); -- cgit v1.2.3-54-g00ecf