Merge pull request #700 from pclouds/tests-without-chibi-test

make optional-test and diff-test run without (chibi test)
This commit is contained in:
Alex Shinn 2020-09-01 23:00:19 +09:00 committed by GitHub
commit 24b1e5024c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View file

@ -1,10 +1,11 @@
(define-library (chibi diff-test)
(import (scheme base) (chibi diff) (chibi test))
(import (scheme base) (chibi diff))
(export run-tests)
(cond-expand
(chibi (import (chibi test)))
(else
(import (scheme write))
;; inline (chibi test) to avoid circular dependencies in snow
;; installations
(begin

View file

@ -1,9 +1,10 @@
(define-library (chibi optional-test)
(import (scheme base) (chibi optional) (chibi test))
(import (scheme base) (chibi optional))
(cond-expand
(chibi (import (chibi test)))
(else
(import (scheme write))
;; inline (chibi test) to avoid circular dependencies in snow
;; installations
(begin
@ -52,13 +53,18 @@
(test '(0 1 (2 3 4))
(let-optionals '(0 1 2 3 4) ((a 10) (b 11) . c)
(list a b c)))
(test-error '(0 11 12)
(cond-expand
(gauche) ; gauche detects this at compile-time, can't catch
(else (test-error '(0 11 12)
((opt-lambda (a (b 11) (c 12))
(list a b c))))
(list a b c))))))
(let ()
(define-opt (f a (b 11) (c 12))
(list a b c))
(test-error (f))
(cond-expand
(gauche)
(else
(test-error (f))))
(test '(0 11 12) (f 0))
(test '(0 1 12) (f 0 1))
(test '(0 1 2) (f 0 1 2))