mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 06:09:18 +02:00
most tests can now be run without modules enabled
This commit is contained in:
parent
0ad4d2ff63
commit
052de70a20
12 changed files with 58 additions and 20 deletions
|
@ -1,6 +1,8 @@
|
|||
;;;; these will fail when compiled either without flonums or trig funcs
|
||||
|
||||
(import (only (chibi test) test-begin test-assert test test-end))
|
||||
(cond-expand
|
||||
(modules (import (only (chibi test) test-begin test-assert test test-end)))
|
||||
(else #f))
|
||||
|
||||
(test-begin "floating point")
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
(import (srfi 69) (only (chibi test) test-begin test test-end))
|
||||
(cond-expand
|
||||
(modules (import (srfi 69) (only (chibi test) test-begin test test-end)))
|
||||
(else #f))
|
||||
|
||||
(test-begin "hash")
|
||||
|
||||
|
|
|
@ -1,18 +1,24 @@
|
|||
|
||||
(import (chibi test))
|
||||
(cond-expand
|
||||
(modules (import (chibi test)))
|
||||
(else (load "tests/r5rs-tests.scm")))
|
||||
|
||||
(test-begin "libraries")
|
||||
|
||||
(load "tests/flonum-tests.scm")
|
||||
(load "tests/numeric-tests.scm")
|
||||
(load "tests/hash-tests.scm")
|
||||
(load "tests/sort-tests.scm")
|
||||
(load "tests/loop-tests.scm")
|
||||
(load "tests/match-tests.scm")
|
||||
(load "tests/scribble-tests.scm")
|
||||
(load "tests/record-tests.scm")
|
||||
(load "tests/thread-tests.scm")
|
||||
;;(load "tests/weak-tests.scm")
|
||||
(cond-expand (utf-8 (load "tests/unicode-tests.scm")) (else #f))
|
||||
|
||||
(cond-expand
|
||||
(modules
|
||||
(begin
|
||||
(load "tests/record-tests.scm")
|
||||
(load "tests/hash-tests.scm")
|
||||
(load "tests/sort-tests.scm")
|
||||
(load "tests/thread-tests.scm")))
|
||||
(else #f))
|
||||
|
||||
(test-end)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
(import (chibi loop) (only (chibi test) test-begin test test-end))
|
||||
(cond-expand
|
||||
(modules (import (chibi loop) (only (chibi test) test-begin test test-end)))
|
||||
(else (load "lib/chibi/loop/loop.scm")))
|
||||
|
||||
(test-begin "loops")
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
(import (chibi match) (only (chibi test) test-begin test test-end))
|
||||
(cond-expand
|
||||
(modules (import (chibi match) (only (chibi test) test-begin test test-end)))
|
||||
(else (load "lib/chibi/match/match.scm")))
|
||||
|
||||
(test-begin "match")
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
;; these tests are only valid if chibi-scheme is compiled with full
|
||||
;; numeric support (USE_BIGNUMS, USE_FLONUMS and USE_MATH)
|
||||
|
||||
(import (only (chibi test) test-begin test test-end))
|
||||
(cond-expand
|
||||
(modules (import (only (chibi test) test-begin test test-end)))
|
||||
(else #f))
|
||||
|
||||
(test-begin "numbers")
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
(define-syntax test
|
||||
(syntax-rules ()
|
||||
((test name expect expr)
|
||||
(test expect expr))
|
||||
((test expect expr)
|
||||
(begin
|
||||
(set! *tests-run* (+ *tests-run* 1))
|
||||
|
@ -26,7 +28,14 @@
|
|||
(display " expected ") (write expect)
|
||||
(display " but got ") (write res) (newline))))))))
|
||||
|
||||
(define (test-report)
|
||||
(define-syntax test-assert
|
||||
(syntax-rules ()
|
||||
((test-assert expr) (test #t expr))))
|
||||
|
||||
(define (test-begin . name)
|
||||
#f)
|
||||
|
||||
(define (test-end)
|
||||
(write *tests-passed*)
|
||||
(display " out of ")
|
||||
(write *tests-run*)
|
||||
|
@ -37,6 +46,8 @@
|
|||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(test-begin "r5rs")
|
||||
|
||||
(test 8 ((lambda (x) (+ x x)) 4))
|
||||
|
||||
(test '(3 4 5 6) ((lambda x x) 3 4 5 6))
|
||||
|
@ -462,4 +473,4 @@
|
|||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(test-report)
|
||||
(test-end)
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
|
||||
(import (srfi 99 records syntactic)
|
||||
(only (chibi test) test-begin test-assert test test-end))
|
||||
(cond-expand
|
||||
(modules
|
||||
(import (srfi 99 records syntactic)
|
||||
(only (chibi test) test-begin test-assert test test-end)))
|
||||
(else #f))
|
||||
|
||||
(test-begin "records")
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
(import (chibi scribble) (only (chibi test) test-begin test test-end))
|
||||
(cond-expand
|
||||
(modules (import (chibi scribble) (only (chibi test) test-begin test test-end)))
|
||||
(else (load "lib/chibi/scribble.scm")))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
(import (srfi 95) (only (chibi test) test-begin test test-end))
|
||||
(cond-expand
|
||||
(modules (import (srfi 95) (only (chibi test) test-begin test test-end)))
|
||||
(else #f))
|
||||
|
||||
(test-begin "sorting")
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
(import (srfi 18) (only (chibi test) test-begin test test-end))
|
||||
(cond-expand
|
||||
(modules (import (srfi 18) (only (chibi test) test-begin test test-end)))
|
||||
(else #f))
|
||||
|
||||
(test-begin "threads")
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
;; These tests are only valid if chibi-scheme is compiled with Unicode
|
||||
;; support (SEXP_USE_UTF8_STRINGS).
|
||||
|
||||
(import (only (chibi test) test-begin test test-end))
|
||||
(cond-expand
|
||||
(modules (import (only (chibi test) test-begin test test-end)))
|
||||
(else #f))
|
||||
|
||||
(test-begin "unicode")
|
||||
|
||||
|
@ -40,7 +42,7 @@
|
|||
(string-fill! s #\字)
|
||||
s))
|
||||
|
||||
(import (chibi loop))
|
||||
(cond-expand (modules (import (chibi loop))) (else #f))
|
||||
|
||||
(test "in-string"
|
||||
'(#\日 #\本 #\語)
|
||||
|
|
Loading…
Add table
Reference in a new issue