Skip to content
Browse files

[t/spec] regression tests for RT #60898 (ranges + infix:<Z>)

git-svn-id: http://svn.pugscode.org/pugs@24122 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent de8877b commit e8dc6d689e7858d8966300403c710b2109500a66 moritz committed
Showing with 11 additions and 2 deletions.
  1. +11 −2 S03-operators/range.t
View
13 S03-operators/range.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 72;
+plan 76;
# 3..2 must *not* produce "3 2". Use reverse to get a reversed range. -lwall
@@ -66,6 +66,16 @@ is [^-1], [], "unary ^-1 produces null range";
is [^0.1], [0], "unary ^0.1 produces the range 0..^x where 0 < x < 1";
is [^'a'], [], "unary ^'a' produces null range";
+# test that the zip operator works with ranges
+
+is (1..5 Z <a b c>).join('|'), '1|a|2|b|3|c', 'Ranges and infix:<Z>';
+is (1..2 Z <a b c>).join('|'), '1|a|2|b', 'Ranges and infix:<Z>';
+is (<c b a> Z 1..5).join('|'), 'c|1|b|2|a|3', 'Ranges and infix:<Z>';
+
+# two ranges
+is (1..6 Z 'a' .. 'c').join(''), '1a2b3c', 'Ranges and infix:<Z>';
+
+
{
# Test with floats
# 2006-12-05:
@@ -103,7 +113,6 @@ is [^'a'], [], "unary ^'a' produces null range";
## remove these tests from the suite.
#?rakudo skip 'MMD function __cmp not found for types (101, 95)'
{
- my @one = (1,);
my @three = (1, 1, 1);
is ~(@one .. 3) , "1 2 3", "lower inclusive limit is in scalar context";

0 comments on commit e8dc6d6

Please sign in to comment.
Something went wrong with that request. Please try again.