Skip to content

Commit

Permalink
Tweak substr(Range) tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Aug 5, 2015
1 parent ffc5993 commit b536f89
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions S32-str/substr.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 55;
plan 57;

# L<S32::Str/Str/=item substr>

Expand Down Expand Up @@ -79,17 +79,20 @@ plan 55;

my $str = "hello foo and bar";

is(substr($str, 6..8), "foo", "substr (substr(Range)).");
is($str.substr(6..8), "foo", "substr (substr(Range)).");
is substr($str, 6..8), "foo", "substr (substr(Range))";
is $str.substr(6..8), "foo", "substr (substr(Range))";

is(substr($str, 6^..8), "oo", "substr (substr(Range)).");
is($str.substr(6^..8), "oo", "substr (substr(Range)).");
is substr($str, 6^..8), "oo", "substr (substr(^Range))";
is $str.substr(6^..8), "oo", "substr (substr(^Range))";

is(substr($str, 6..^8), "fo", "substr (substr(Range)).");
is($str.substr(6..^8), "fo", "substr (substr(Range)).");
is substr($str, 6..^8), "fo", "substr (substr(Range^))";
is $str.substr(6..^8), "fo", "substr (substr(Range^))";

is(substr($str, 6^..^8), "o", "substr (substr(Range)).");
is($str.substr(6^..^8), "o", "substr (substr(Range)).");
is substr($str, 6^..^8), "o", "substr (substr(^Range^))";
is $str.substr(6^..^8), "o", "substr (substr(^Range^))";

is substr($str, 10..*), "and bar", "substr (substr(Range Inf))";
is $str.substr(10..*), "and bar", "substr (substr(Range Inf))";
}

#?niecza todo
Expand Down

0 comments on commit b536f89

Please sign in to comment.