test: Move srfi-1 for-each and map tests to tests/srfi-1.test.

This fixes: `make check MES=guile'.

* tests/srfi-1.test ("map 1,2", "map 2,1", "for-each 1,2",
for-each 2,1"): Move from scm.test.
* tests/scm.test ("map 1,2", "map 2,1", "for-each 1,2",
for-each 2,1"): Remove.
This commit is contained in:
Jan Nieuwenhuizen 2019-05-29 16:30:25 +02:00
parent 26e88603d4
commit 27d771e6ab
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
2 changed files with 14 additions and 14 deletions

View file

@ -47,22 +47,8 @@ exec ${MES-mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests boot
(pass-if "map 2 " (sequal? (map (lambda (i a) (cons i a)) '(1 2 3 4) '(a b c d)) (pass-if "map 2 " (sequal? (map (lambda (i a) (cons i a)) '(1 2 3 4) '(a b c d))
'((1 . a) (2 . b) (3 . c) (4 . d)))) '((1 . a) (2 . b) (3 . c) (4 . d))))
(pass-if-equal "map 1,2"
'((0 . a))
(map (lambda (x y) (cons x y)) '(0) '(a b)))
(pass-if-equal "map 2,1"
'((0 . a))
(map (lambda (x y) (cons x y)) '(0 1) '(a)))
(pass-if "for-each" (sequal? (let ((acc '())) (for-each (lambda (x) (set! acc (cons x acc))) '(1 2 3 4)) acc) '(4 3 2 1))) (pass-if "for-each" (sequal? (let ((acc '())) (for-each (lambda (x) (set! acc (cons x acc))) '(1 2 3 4)) acc) '(4 3 2 1)))
(pass-if "for-each 1,2"
(for-each (lambda (x y) (cons x y)) '(0) '(a b)))
(pass-if "for-each 2,1"
(for-each (lambda (x y) (cons x y)) '(0 1) '(a)))
(define xxxa 0) (define xxxa 0)
(pass-if "set! " (seq? (begin (set! xxxa 1) xxxa) 1)) (pass-if "set! " (seq? (begin (set! xxxa 1) xxxa) 1))
(pass-if "set! 2" (seq? (let ((a 0)) (set! a 1) a) 1)) (pass-if "set! 2" (seq? (let ((a 0)) (set! a 1) a) 1))

View file

@ -34,6 +34,20 @@ exec ${MES-src/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests
(pass-if "first dummy" #t) (pass-if "first dummy" #t)
(pass-if-not "second dummy" #f) (pass-if-not "second dummy" #f)
(pass-if-equal "map 1,2"
'((0 . a))
(map (lambda (x y) (cons x y)) '(0) '(a b)))
(pass-if-equal "map 2,1"
'((0 . a))
(map (lambda (x y) (cons x y)) '(0 1) '(a)))
(pass-if "for-each 1,2"
(for-each (lambda (x y) (cons x y)) '(0) '(a b)))
(pass-if "for-each 2,1"
(for-each (lambda (x y) (cons x y)) '(0 1) '(a)))
(pass-if-equal "fold" (pass-if-equal "fold"
'(3 2 1) '(3 2 1)
(fold cons '() '(1 2 3))) (fold cons '() '(1 2 3)))