Skip to content

Commit

Permalink
Add Range.Bool tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Feb 28, 2023
1 parent c704932 commit 040622c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S02-types/range.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 193;
plan 205;

# basic Range
# L<S02/Immutable types/A pair of Ordered endpoints>
Expand Down Expand Up @@ -461,4 +461,14 @@ subtest 'no floating point drifts in degenerate Ranges' => {
is-deeply @a, ["1","2","3","4","5","6","7","8","9"], 'did we get strings';
}

# https://github.com/rakudo/rakudo/issues/5222
{
for 1..1, 1^..2, 1..^2, 1^..^3, "a".."a", 1..* -> $range {
is-deeply $range.Bool, True, "$range.raku().Bool is True";
}
for 1..0, 1^..1, 1..^1, 1^..^2, "b".."a", 1..-Inf -> $range {
is-deeply $range.Bool, False, "$range.raku().Bool is False";
}
}

# vim: expandtab shiftwidth=4

0 comments on commit 040622c

Please sign in to comment.