File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
tests/unittests/resources/LangSuite Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 106106 (test:eq (@ "hello" -4) "e")
107107 (test:eq (@ ["h" "e" "l" "l" "o"] 1) "e")
108108 (test:eq (@ ["h" "e" "l" "l" "o"] -1) "o")
109- (test:eq (@ ["h" "e" "l" "l" "o"] -4) "e") })
109+ (test:eq (@ ["h" "e" "l" "l" "o"] -4) "e")
110+
111+ (let lst [1 2 3])
112+ (let idx 1)
113+ # AT_SYM_INDEX_SYM_INDEX
114+ (test:eq (@ lst idx) 2) })
110115
111116 (test:case "Short-circuiting" {
112117 (let falsy (fun () {
180185 (mut data [])
181186 (append! ((fun () data)) 5) })
182187
188+ (test:case "optimized jumps" {
189+ (mut i 10)
190+ (let n 5)
191+ # GT_SYM_JUMP_IF_FALSE
192+ (while (> i n) (set i (- i 1)))
193+ # GT_CONST_JUMP_IF_FALSE
194+ (while (> i 5) (set i (- i 1)))
195+ (test:eq i 5) })
196+
183197 (test:case "set/store head and tail" {
184198 (mut data [1 2 3 4])
185199 # STORE_TAIL_BY_INDEX
You can’t perform that action at this time.
0 commit comments