Permalink
Browse files

[t/spec] a test for Range.map

git-svn-id: http://svn.pugscode.org/pugs@24505 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 82205cd commit f07dd23a7e176020eac80520ba0ec7891148fe09 moritz committed Dec 19, 2008
Showing with 8 additions and 1 deletion.
  1. +8 −1 S03-operators/range.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 76;
+plan 77;
# 3..2 must *not* produce "3 2". Use reverse to get a reversed range. -lwall
@@ -114,6 +114,7 @@ is (1..6 Z 'a' .. 'c').join(''), '1a2b3c', 'Ranges and infix:<Z>';
#?rakudo skip 'MMD function __cmp not found for types (101, 95)'
{
my @three = (1, 1, 1);
+ my @one = 1;
is ~(@one .. 3) , "1 2 3", "lower inclusive limit is in scalar context";
is ~(@one ^.. 3) , "2 3" , "lower exclusive limit is in scalar context";
@@ -128,4 +129,10 @@ is (1..6 Z 'a' .. 'c').join(''), '1a2b3c', 'Ranges and infix:<Z>';
is ~(@three ^..^ @one), "" , "both exclusive limits are in scalar context";
}
+# test that .map works on ranges
+#?rakudo skip 'map on range'
+{
+ is (0..3).map({$_ * 2}).join('|'), '0|2|4|6', '.map works on ranges';
+}
+
# For tests involving :by, see t/operators/adverbial_modifiers.t

0 comments on commit f07dd23

Please sign in to comment.