Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
track nom regressions.
  • Loading branch information
coke committed Jul 10, 2011
1 parent e982a79 commit a4c379f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions S32-array/exists.t
Expand Up @@ -21,6 +21,7 @@ ok @array.exists(2), "exists(positive index) on arrays (3)";
ok @array.exists(3), "exists(positive index) on arrays (4)";
ok !@array.exists(4), "exists(positive index) on arrays (5)";
ok !@array.exists(42), "exists(positive index) on arrays (2)";
#?rakudo todo 'nom regression'
ok !@array.exists(-1), "exists(negative index) on arrays (1)";
#?rakudo 6 skip 'Pm wants spec clarification'
ok @array.exists(*-1), "exists(negative index) on arrays (1)";
Expand Down
11 changes: 11 additions & 0 deletions S32-str/rindex.t
Expand Up @@ -28,11 +28,16 @@ is(rindex("Hello World", "Hello World"), 0, "Substr eq Str");

# Empty strings

#?rakudo todo 'nom regression'
is(rindex("Hello World", ""), 11, "Substr is empty");
#?rakudo todo 'nom regression'
is(rindex("", ""), 0, "Both strings are empty");
ok(!defined(rindex("", "Hello")), "Only main-string is empty");
#?rakudo todo 'nom regression'
is(rindex("Hello", "", 3), 3, "Substr is empty, pos within str");
#?rakudo todo 'nom regression'
is(rindex("Hello", "", 5), 5, "Substr is empty, pos at end of str");
#?rakudo todo 'nom regression'
is(rindex("Hello", "", 999), 5, "Substr is empty, pos > length of str");

# More difficult strings
Expand All @@ -46,21 +51,27 @@ is(rindex("Ümlaut", "Ü"), 0, "Umlaut");
is(rindex("what are these « » unicode characters for ?", "uni"), 19, "over unicode characters");

# .rindex use
#?rakudo todo 'nom regression'
is("Hello World".rindex("l"), 9, ".rindex on string");
#?rakudo todo 'nom regression'
is("Hello World".rindex(''), 11, ".rindex('') on string gives string length in bytes");

# on scalar variable
my $s = "Hello World";
is(rindex($s, "o"), 7, "rindex on scalar variable");
#?rakudo todo 'nom regression'
is($s.rindex("o"), 7, ".rindex on scalar variable");

is(rindex(uc($s), "O"), 7, "rindex on uc");
#?rakudo todo 'nom regression'
is($s.uc.rindex("O"), 7, ".uc.rindex ");

# ideas for deeper chained . calls ?
#?rakudo todo 'nom regression'
is($s.lc.ucfirst.rindex("w"), 6, ".lc.ucfirst.rindex");

# rindex on non-strings
#?rakudo todo 'nom regression'
ok 3459.rindex(5) == 2, 'rindex on integers';

# vim: ft=perl6

0 comments on commit a4c379f

Please sign in to comment.