preprocessor tests
svn: r11787 original commit: ffde7e7b42fdf8d9c085ce3592f025b53e6481d3
This commit is contained in:
parent
5cee45dc0b
commit
4e0988f3a8
|
@ -1,6 +1,8 @@
|
|||
#lang scheme/base
|
||||
|
||||
(require tests/eli-tester scribble/text/syntax-utils)
|
||||
(require tests/eli-tester scribble/text/syntax-utils scheme/runtime-path)
|
||||
|
||||
(define-runtime-path text-dir "text")
|
||||
|
||||
(test
|
||||
|
||||
|
@ -76,4 +78,17 @@
|
|||
(f 3 #:> "]" #:< "["))
|
||||
=> '(1 ("<" 1 ">") ("[" 2 ">") ("[" 3 "]"))
|
||||
|
||||
;; preprocessor functionality
|
||||
(parameterize ([current-directory text-dir])
|
||||
(for ([ifile (map path->string (directory-list))]
|
||||
#:when (and (file-exists? ifile)
|
||||
(regexp-match? #rx"^i[0-9]+$" ifile)))
|
||||
(define ofile (regexp-replace #rx"^i" ifile "o"))
|
||||
(define expected (call-with-input-file ofile
|
||||
(lambda (i) (read-bytes (file-size ofile) i))))
|
||||
(define o (open-output-bytes))
|
||||
(parameterize ([current-output-port o])
|
||||
(dynamic-require (path->complete-path ifile) #f))
|
||||
(test (get-output-bytes o) => expected)))
|
||||
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user