Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[t/spec] test that .first and .reduce work on ranges

git-svn-id: http://svn.pugscode.org/pugs@24555 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit b0e0a3acf12edd3859307fe1b0d0bb88280f746b 1 parent 0b0a1eb
moritz authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 S03-operators/range.t
4 S03-operators/range.t
View
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 78;
+plan 80;
# 3..2 must *not* produce "3 2". Use reverse to get a reversed range. -lwall
@@ -133,6 +133,8 @@ is (1..6 Z 'a' .. 'c').join(''), '1a2b3c', 'Ranges and infix:<Z>';
{
is (0..3).map({$_ * 2}).join('|'), '0|2|4|6', '.map works on ranges';
is (0..3).grep({$_ == 1|3}).join('|'), '1|3', '.grep works on ranges';
+ is (1..3).first({ $_ % 2 == 0}), 2, '.first works on ranges';
+ is (1..3).reduce({ $^a + $^b}), 6, '.reduce works on ranges';
}
# For tests involving :by, see t/operators/adverbial_modifiers.t
Please sign in to comment.
Something went wrong with that request. Please try again.