Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refudge for niecza.

  • Loading branch information...
commit 231116511b4f2ecc7ca164831dd882fda16d7db3 1 parent 94e7168
@colomon colomon authored
Showing with 6 additions and 27 deletions.
  1. +6 −27 S03-operators/range.t
View
33 S03-operators/range.t
@@ -8,48 +8,30 @@ plan 114;
# L<S03/Nonchaining binary precedence/Range object constructor>
# 3..2 must *not* produce "3 2". Use reverse to get a reversed range. -lwall
-#?niecza todo
is ~(3..6), "3 4 5 6", "(..) works on numbers (1)";
-#?niecza todo
is ~(3..3), "3", "(..) works on numbers (2)";
-#?niecza todo
is ~(3..2), "", "(..) works on auto-rev numbers (3)";
-#?niecza todo
is ~(8..11), "8 9 10 11", "(..) works on carried numbers (3)";
-#?niecza todo
is ~("a".."c"), "a b c", "(..) works on chars (1)";
-#?niecza todo
is ~("a".."a"), "a", "(..) works on chars (2)";
-#?niecza todo
is ~("b".."a"), "", "(..) works on chars (3)";
-#?niecza todo
is ~("a".."z"), "a b c d e f g h i j k l m n o p q r s t u v w x y z", "(..) works on char range ending in z";
-#?niecza todo
is ~("A".."Z"), "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z", "(..) works on char range ending in Z";
-#?niecza todo
is ~("Y".."AB"), "", "(..) works on carried chars (3)";
#?rakudo 4 skip 'Spec under design here'
-#?niecza todo
+#?niecza 4 skip 'Spec under design here'
is ~('Y'..'z'), 'Y Z', '(..) works on uppercase letter .. lowercase letter (1)';
-#?niecza todo
is ~('z'..'Y'), '', '(..) works on auto-rev uppercase letter .. lowercase letter (2)';
-#?niecza todo
is ~('Y'..'_'), 'Y Z', '(..) works on letter .. non-letter (1)';
-#?niecza todo
is ~('_'..'Y'), '', '(..) works on auto-rev letter .. non-letter (2)';
#?rakudo skip "nom regression: No applicable candidates found to dispatch to for 'Numeric'."
-#?niecza todo
is ~(' '..' '), ' ', 'all-whitespace range works';
-#?niecza todo
is ~(3..9-3), "3 4 5 6", "(..) has correct precedence (1)";
-#?niecza todo
is ~(5..9-5), "", "(..) has correct precedence (2)";
-#?niecza todo
is ~(2+1..6), "3 4 5 6", "(..) has correct precedence (3)";
-#?niecza todo
is ~(2+5..6), "", "(..) has correct precedence (4)";
# Test the three exclusive range operators:
@@ -84,7 +66,6 @@ is ('a'..'z').list.join(' '), 'a b c d e f g h i j k l m n o p q r s t u v w x y
is 1.5 ~~ 1^..^2, Bool::True, "lazy evaluation of the range operator";
# Test the unary ^ operator
-#?niecza todo
is ~(^5), "0 1 2 3 4", "unary ^num produces the range 0..^num";
is [^1], [0], "unary ^ on the boundary ^1 works";
is [^0], [], "unary ^0 produces null range";
@@ -92,7 +73,6 @@ is [^-1], [], "unary ^-1 produces null range";
is [^0.1], [0], "unary ^0.1 produces the range 0..^x where 0 < x < 1";
#?niecza skip 'System.FormatException: Unknown char: a'
is [^'a'], [], "unary ^'a' produces null range";
-#?niecza todo
is ~(^"5"), "0 1 2 3 4", 'unary ^"num" produces the range 0..^num';
{
@@ -118,7 +98,7 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
# 16:16 <TimToady> ~(1.9 ^..^ 4.9) should produce 2.9, 3.9
# 16:17 <pmichaud> and ~(1.9 ^..^ 4.5) would produce the same?
# 16:17 <TimToady> yes
- #?niecza 16 todo
+ #?niecza 4 todo
is ~(1.1 .. 4) , "1.1 2.1 3.1", "range with float .min";
is ~(1.9 .. 4) , "1.9 2.9 3.9", "range with float .min";
is ~(1.1 ^.. 4), "2.1 3.1" , "bottom exclusive range of float";
@@ -129,11 +109,13 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
is ~(1 ..^ 4.1), "1 2 3 4", "top exclusive range of float";
is ~(1 ..^ 4.9), "1 2 3 4", "top exclusive range of float";
+ #?niecza 4 todo
is ~(1.1 .. 4.1), "1.1 2.1 3.1 4.1", "range with float .min/.max";
is ~(1.9 .. 4.1), "1.9 2.9 3.9" , "range with float .min/.max";
is ~(1.1 .. 4.9), "1.1 2.1 3.1 4.1", "range with float .min/.max";
is ~(1.9 .. 4.9), "1.9 2.9 3.9 4.9", "range with float .min/.max";
+ #?niecza 4 todo
is ~(1.1 ^..^ 4.1), "2.1 3.1" , "both exclusive float range";
is ~(1.9 ^..^ 4.1), "2.9 3.9" , "both exclusive float range";
is ~(1.1 ^..^ 4.9), "2.1 3.1 4.1", "both exclusive float range";
@@ -150,7 +132,7 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
## remove these tests from the suite.
# RT #58018
# RT #76950
-#?niecza todo
+#?niecza skip "Unhandled exception: cannot increment a value of type Array"
{
my @three = (1, 1, 1);
my @one = 1;
@@ -188,7 +170,6 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
#?rakudo todo "RT #105014"
lives_ok { "$range" }, 'can stringify range';
#?rakudo skip "nom regression: No applicable candidates found to dispatch to for 'Numeric'."
- #?niecza todo
is ~$range, "100.B 101.B 102.B", 'range is correct';
}
@@ -200,8 +181,8 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
is $range.min, 1, 'range starts at one';
is $range.max, 3, 'range ends at three';
#?rakudo 2 skip "range stringification: Method 'succ' not found for invocant of class 'Match'"
+ #?niecza 2 skip 'cannot increment a value of type Match'
lives_ok { "$range" }, 'can stringify range';
- #?niecza todo
is ~$range, "1 2 3", 'range is correct';
}
# and another set, just for the lulz
@@ -220,7 +201,6 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
is $range.min, 1, 'range starts at one';
is $range.max, 3, 'range ends at three';
lives_ok { "$range" }, 'can stringify range';
- #?niecza todo
is ~$range, "1 2 3", 'range is correct';
}
{
@@ -232,7 +212,6 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
is $range.max, 3, 'range ends at three';
is $range.max.WHAT.gist, "Str()", 'range end is a string';
lives_ok { "$range" }, 'can stringify range';
- #?niecza todo
is ~$range, "1 2 3", 'range is correct';
}
Please sign in to comment.
Something went wrong with that request. Please try again.