about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--032array.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/032array.cc b/032array.cc
index b8b4088a..c9182912 100644
--- a/032array.cc
+++ b/032array.cc
@@ -305,6 +305,17 @@ void test_array_length_compound() {
   CHECK_EQ(array_length(x), 3);
 }
 
+:(scenario index_truncates)
+def main [
+  1:array:num:3 <- create-array
+  2:num <- copy 14
+  3:num <- copy 15
+  4:num <- copy 16
+  5:num <- index 1:array:num:3, 1.5  # non-whole number
+]
+# fraction is truncated away
++mem: storing 15 in location 5
+
 :(scenario index_out_of_bounds)
 % Hide_errors = true;
 def main [