restricting test imports

This commit is contained in:
Alex Shinn 2011-04-26 00:08:58 +09:00
parent 78a2e2aa10
commit 32718a0a6a
10 changed files with 14 additions and 42 deletions

View file

@ -1,6 +1,6 @@
;;;; these will fail when compiled either without flonums or trig funcs
(import (chibi test))
(import (only (chibi test) test-begin test-assert test test-end))
(test-begin "floating point")

View file

@ -1,5 +1,5 @@
(import (srfi 69) (chibi test))
(import (srfi 69) (only (chibi test) test-begin test test-end))
(test-begin "hash")

View file

@ -1,5 +1,5 @@
(import (chibi loop) (chibi test))
(import (chibi loop) (only (chibi test) test-begin test test-end))
(test-begin "loops")

View file

@ -1,5 +1,5 @@
(import (chibi match) (chibi test))
(import (chibi match) (only (chibi test) test-begin test test-end))
(test-begin "match")

View file

@ -2,7 +2,7 @@
;; these tests are only valid if chibi-scheme is compiled with full
;; numeric support (USE_BIGNUMS, USE_FLONUMS and USE_MATH)
(import (chibi test))
(import (only (chibi test) test-begin test test-end))
(test-begin "numbers")

View file

@ -1,5 +1,6 @@
(import (srfi 99 records syntactic) (chibi test))
(import (srfi 99 records syntactic)
(only (chibi test) test-begin test-assert test test-end))
(test-begin "records")

View file

@ -1,39 +1,10 @@
(import (chibi scribble))
(define *tests-run* 0)
(define *tests-passed* 0)
(define-syntax test
(syntax-rules ()
((test str expect expr)
(begin
(set! *tests-run* (+ *tests-run* 1))
(let ((res expr))
(display str)
(write-char #\space)
(display (make-string (max 0 (- 72 (string-length str))) #\.))
(flush-output)
(cond
((equal? res expect)
(set! *tests-passed* (+ *tests-passed* 1))
(display " [PASS]\n"))
(else
(display " [FAIL]\n")
(display " expected ") (write expect)
(display " but got ") (write res) (newline))))))))
(define (test-report)
(write *tests-passed*)
(display " out of ")
(write *tests-run*)
(display " passed (")
(write (* (/ *tests-passed* *tests-run*) 100))
(display "%)")
(newline))
(import (chibi scribble) (only (chibi test) test-begin test test-end))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(test-begin "scribble")
(define (test-scribble expect str)
(test (call-with-output-string (lambda (out) (write str out)))
expect
@ -234,4 +205,4 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(test-report)
(test-end)

View file

@ -1,5 +1,5 @@
(import (srfi 95) (chibi test))
(import (srfi 95) (only (chibi test) test-begin test test-end))
(test-begin "sorting")

View file

@ -1,5 +1,5 @@
(import (srfi 18) (chibi test))
(import (srfi 18) (only (chibi test) test-begin test test-end))
(test-begin)

View file

@ -1,7 +1,7 @@
;; These tests are only valid if chibi-scheme is compiled with Unicode
;; support (SEXP_USE_UTF8_STRINGS).
(import (chibi test))
(import (only (chibi test) test-begin test test-end))
(test-begin "unicode")