Browse files

[t/spec] grep with non-Code matcher

git-svn-id: http://svn.pugscode.org/pugs@26881 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 4e0660e commit 5b7f1a91b5831e025784cf15ce97f07d1486f01f moritz committed May 19, 2009
Showing with 13 additions and 1 deletion.
  1. +13 −1 S32-list/grep.t
View
14 S32-list/grep.t
@@ -9,7 +9,7 @@ built-in grep tests
=end pod
-plan 36;
+plan 38;
my @list = (1 .. 10);
@@ -95,3 +95,15 @@ my @list = (1 .. 10);
'2|4|6|8|12', 'next works in grep';
}
+# since the test argument to .grep is a Matcher, we can also
+# check type constraints:
+
+{
+ is (2, [], 4, [], 5).grep(Int).join(','),
+ '2,4,5', ".grep with non-Code matcher";
+
+ is grep(Int, 2, [], 4, [], 5).join(','),
+ '2,4,5', "grep() with non-Code matcher";
+}
+
+# vim: ft=perl6

0 comments on commit 5b7f1a9

Please sign in to comment.