moving to a new numeric reading algorithm.
added: src/tests/reader.ss
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
(library (tests reader)
|
||||
(export test-reader)
|
||||
(import (ikarus) (tests framework))
|
||||
|
||||
(define t
|
||||
(lambda (str)
|
||||
(lambda (n?)
|
||||
(and (number? n?)
|
||||
(= (with-input-from-string str read) n?)))))
|
||||
|
||||
(define-syntax reader-tests
|
||||
(syntax-rules ()
|
||||
[(_ name str* ...)
|
||||
(define-tests name
|
||||
[(t str*) (string->number str*)] ...)]))
|
||||
|
||||
(reader-tests test-reader
|
||||
"12"))
|
||||
|
||||
Reference in New Issue
Block a user