Support negative start and end in ranges (#4249)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2024-10-22 14:28:48 +13:00
committed by GitHub
parent 26042790b6
commit 4bd7e02271
3 changed files with 6 additions and 7 deletions

View File

@ -1,3 +1,2 @@
xs = [-5..5]
xs = [int(-5)..5]
assertEqual(xs[0], -5, 0.001, "first element is -5")
assert(false)

View File

@ -101,7 +101,7 @@ gen_test!(property_of_object);
gen_test!(index_of_array);
gen_test!(comparisons);
gen_test!(array_range_expr);
gen_test_fail!(array_range_negative_expr, "syntax: Invalid integer: -5.0");
gen_test!(array_range_negative_expr);
gen_test_fail!(
invalid_index_str,
"semantic: Only integers >= 0 can be used as the index of an array, but you're using a string"