shithub: femtolisp

Download patch

ref: 304a0473edc6714ef98a199eeffcf137651461d4
parent: 51fa9c06a52b80fb3fd952786aea48bb7acc19d2
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sun Jan 12 17:59:29 EST 2025

unit tests: for-each with multiple lists: order with table is not guaranteed

--- a/test/unittest.lsp
+++ b/test/unittest.lsp
@@ -401,8 +401,8 @@
 
 ;; for-each with multiple lists
 (define q '())
-(for-each (λ (x y k v) (set! q (cons (+ x y k v) q))) #(1 2 3) #vu8(4 5 6) (table 0 7 1 7 2 7))
-(assert (equal? q '(18 15 12)))
+(for-each (λ (x y) (set! q (cons (+ x y) q))) #(1 2 3) #vu8(4 5 6))
+(assert (equal? q '(9 7 5)))
 (define q 0)
 (for-each (λ (x y) (set! q (+ x y q))) '(1) '(3 9))
 (assert (equal? q 4))