[libcatmandu-perl] 26/101: Adding test for each_until

Jonas Smedegaard dr at jones.dk
Tue Feb 23 13:43:50 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libcatmandu-perl.

commit a1e0a308921de1e4c1536cc7c54f1d31c4422465
Author: Patrick Hochstenbach <patrick.hochstenbach at ugent.be>
Date:   Fri Dec 11 14:38:44 2015 +0100

    Adding test for each_until
---
 t/Catmandu-ArrayIterator.t | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/t/Catmandu-ArrayIterator.t b/t/Catmandu-ArrayIterator.t
index 4ba7312..d2923b0 100644
--- a/t/Catmandu-ArrayIterator.t
+++ b/t/Catmandu-ArrayIterator.t
@@ -39,4 +39,12 @@ $it->each(sub {
 	is shift->{n} , ++$count , "each ($count)";
 });
 
-done_testing 13;
+$it->rewind;
+
+my $count = 0;
+$it->each_until(sub {
+	is shift->{n} , ++$count , "each ($count)";
+	return $count == 2 ? undef : 1;
+});
+
+done_testing 15;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-perl.git



More information about the Pkg-perl-cvs-commits mailing list