Added test to ensure array push is immutable (#4361)

added test to ensure array push is immutable
This commit is contained in:
Arnav Gupta
2024-10-30 19:04:26 -04:00
committed by GitHub
parent 43bec115c0
commit a8b816a3e2
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,3 @@
arr = [1, 2, 3]
pushedArr = push(arr, 4)
fail = arr[3]

View File

@ -174,3 +174,7 @@ gen_test_parse_fail!(
gen_test!(add_lots); gen_test!(add_lots);
gen_test!(double_map); gen_test!(double_map);
gen_test!(array_elem_push); gen_test!(array_elem_push);
gen_test_fail!(
array_elem_push_fail,
"undefined value: The array doesn't have any item at index 3"
);