Skip to content
Browse files

[t/spec] forbid lists and ranges as Range end points (as per r28171)

git-svn-id: http://svn.pugscode.org/pugs@28230 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 828aa7c commit 7f76022a4a7cbb67c75395f10755f130892727e2 moritz committed Sep 13, 2009
Showing with 13 additions and 4 deletions.
  1. +13 −3 S03-operators/range.t
  2. +0 −1 TODO
View
16 S03-operators/range.t
@@ -2,7 +2,10 @@ use v6;
use Test;
-plan 104;
+plan 105;
+
+
+# L<S03/Nonchaining binary precedence/Range object constructor>
# 3..2 must *not* produce "3 2". Use reverse to get a reversed range. -lwall
@@ -22,8 +25,6 @@ is ~('z'..'Y'), '', '(..) works on auto-rev uppercase letter .. lowercase let
is ~('Y'..'_'), 'Y Z', '(..) works on letter .. non-letter (1)';
is ~('_'..'Y'), '', '(..) works on auto-rev letter .. non-letter (2)';
-isnt ~(0..^10), ~(0.. ^10), '(0..^10) is not the same as (0.. ^10)';
-
is ~(3..9-3), "3 4 5 6", "(..) has correct precedence (1)";
is ~(5..9-5), "", "(..) has correct precedence (2)";
is ~(2+1..6), "3 4 5 6", "(..) has correct precedence (3)";
@@ -185,6 +186,15 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
is $range.list, <1 2 3>, 'range is correct';
}
+# L<S03/Nonchaining binary precedence/it is illegal to use a Range or a
+# List as implicitly numeric:>
+
+#?rakudo todo 'forbid Ranges and Lists as Range endpoints'
+{
+ ok !defined(try { 0 .. ^10 }), '0 .. ^10 is illegal';
+ ok !defined(try { 0 .. (0, 1, 2) }), '0 .. List is illegal';
+}
+
# For tests involving :by, see t/spec/S03-operators/range-by.t
# and t/operators/adverbial_modifiers.t
View
1 TODO
@@ -38,7 +38,6 @@ the spec (newest first)
* (r27312) ambiguous authority and 'use'
* (r27066) rangechars are not limited to \w anymore
* (r27045) multi method scoping
-* (r28171) [S03] forbid List and Range as endpoint to ranges
* (r28169) :my in regexen
* (r28150, r28151) ::=, implicit 'is context' on $*foo variables
* (r26968) Now we know how $! works.

0 comments on commit 7f76022

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