about summary refs log tree commit diff stats
path: root/lua/chupacabra/test_chupacabra.lua
diff options
context:
space:
mode:
authorelioat <hi@eli.li>2024-06-09 15:14:48 -0400
committerelioat <hi@eli.li>2024-06-09 15:14:48 -0400
commitb4370348822081dce9dc97b24d6a447344c82470 (patch)
tree58058a0f32b9c8b08038367995d9d93498fcdc60 /lua/chupacabra/test_chupacabra.lua
parent14880745b383bd86596b0600c05d673a8834a403 (diff)
downloadtour-b4370348822081dce9dc97b24d6a447344c82470.tar.gz
*
Diffstat (limited to 'lua/chupacabra/test_chupacabra.lua')
-rw-r--r--lua/chupacabra/test_chupacabra.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/chupacabra/test_chupacabra.lua b/lua/chupacabra/test_chupacabra.lua
index 972b5ae..d945009 100644
--- a/lua/chupacabra/test_chupacabra.lua
+++ b/lua/chupacabra/test_chupacabra.lua
@@ -30,7 +30,8 @@ tc("2 [12 6 4] @/", {6.0, 3.0, 2.0})
 tc("[2 2 2] [24 12 16] @/", {12.0, 6.0, 8.0})
 tc("1", 1)  -- 1
 tc("2 1 .", 2) -- 2
--- tc("[1 2 3 4] .", {1, 2, 3, 4}) -- FIXME: this test fails
+tc("[1 2 3 4] 3 .", {1, 2, 3, 4})
+tc("1 [1 2 3 4] .", 1)
 tc("[1 1]", {1, 1})
 tc("3 4 +", 7)  -- 3 + 4 = 7
 tc("5 2 -", 3)  -- 5 - 2 = 3
@@ -42,4 +43,5 @@ tc("7 2 + 3 4 + +", 16)  -- 7 + 2 + 3 + 4 = 16
 tc("5 2 - 3 4 * +", 15)  -- (5 - 2) + (3 * 4) = 15
 tc("8 2 / 3 4 * +", 16.0)  -- (8 / 2) + (3 * 4) = 16
 tc("1 2 3 4 5 ..", {1, 2, 3, 4, 5}) -- construct an array 
-tc("[1 2 3 4 5] [6 7 8 9 10] [10 11 12 13] @..", {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13}) -- combine arrays
\ No newline at end of file
+tc("[1 2 3 4 5] [6 7 8 9 10] [10 11 12 13] @..", {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13}) -- combine arrays
+tc("[10 20 30] 1 @", 10)  -- access array element at a given index (1-based)
\ No newline at end of file