mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-08 13:37:35 +02:00
restricting test imports
This commit is contained in:
parent
78a2e2aa10
commit
32718a0a6a
10 changed files with 14 additions and 42 deletions
|
@ -1,6 +1,6 @@
|
||||||
;;;; these will fail when compiled either without flonums or trig funcs
|
;;;; 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")
|
(test-begin "floating point")
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
(import (srfi 69) (chibi test))
|
(import (srfi 69) (only (chibi test) test-begin test test-end))
|
||||||
|
|
||||||
(test-begin "hash")
|
(test-begin "hash")
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
(import (chibi loop) (chibi test))
|
(import (chibi loop) (only (chibi test) test-begin test test-end))
|
||||||
|
|
||||||
(test-begin "loops")
|
(test-begin "loops")
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
(import (chibi match) (chibi test))
|
(import (chibi match) (only (chibi test) test-begin test test-end))
|
||||||
|
|
||||||
(test-begin "match")
|
(test-begin "match")
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
;; these tests are only valid if chibi-scheme is compiled with full
|
;; these tests are only valid if chibi-scheme is compiled with full
|
||||||
;; numeric support (USE_BIGNUMS, USE_FLONUMS and USE_MATH)
|
;; numeric support (USE_BIGNUMS, USE_FLONUMS and USE_MATH)
|
||||||
|
|
||||||
(import (chibi test))
|
(import (only (chibi test) test-begin test test-end))
|
||||||
|
|
||||||
(test-begin "numbers")
|
(test-begin "numbers")
|
||||||
|
|
||||||
|
|
|
@ -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")
|
(test-begin "records")
|
||||||
|
|
||||||
|
|
|
@ -1,39 +1,10 @@
|
||||||
|
|
||||||
(import (chibi scribble))
|
(import (chibi scribble) (only (chibi test) test-begin test test-end))
|
||||||
|
|
||||||
(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))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(test-begin "scribble")
|
||||||
|
|
||||||
(define (test-scribble expect str)
|
(define (test-scribble expect str)
|
||||||
(test (call-with-output-string (lambda (out) (write str out)))
|
(test (call-with-output-string (lambda (out) (write str out)))
|
||||||
expect
|
expect
|
||||||
|
@ -234,4 +205,4 @@
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(test-report)
|
(test-end)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
(import (srfi 95) (chibi test))
|
(import (srfi 95) (only (chibi test) test-begin test test-end))
|
||||||
|
|
||||||
(test-begin "sorting")
|
(test-begin "sorting")
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
(import (srfi 18) (chibi test))
|
(import (srfi 18) (only (chibi test) test-begin test test-end))
|
||||||
|
|
||||||
(test-begin)
|
(test-begin)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;; These tests are only valid if chibi-scheme is compiled with Unicode
|
;; These tests are only valid if chibi-scheme is compiled with Unicode
|
||||||
;; support (SEXP_USE_UTF8_STRINGS).
|
;; support (SEXP_USE_UTF8_STRINGS).
|
||||||
|
|
||||||
(import (chibi test))
|
(import (only (chibi test) test-begin test test-end))
|
||||||
|
|
||||||
(test-begin "unicode")
|
(test-begin "unicode")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue