From 040622c267561cc19186715e2f2eddee829a4459 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Tue, 28 Feb 2023 10:53:27 +0100 Subject: [PATCH] Add Range.Bool tests Related to https://github.com/rakudo/rakudo/issues/5222 --- S02-types/range.t | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/S02-types/range.t b/S02-types/range.t index b94fec3ea4..10d3d5f248 100644 --- a/S02-types/range.t +++ b/S02-types/range.t @@ -2,7 +2,7 @@ use v6; use Test; -plan 193; +plan 205; # basic Range # L @@ -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