bkyk8rc3zvpnsf5inmcqq4n3k98cv6hj-my-site-hyper-literate-git.test.suzanne.soy-0.0.1

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 4e0988f3a822ef34e275bd5365f3513e406cb167
parent 5cee45dc0be3d7a7600c3ce41b06ab3c4ff50449
Author: Eli Barzilay <eli@racket-lang.org>
Date:   Wed, 17 Sep 2008 14:19:55 +0000

preprocessor tests

svn: r11787

original commit: ffde7e7b42fdf8d9c085ce3592f025b53e6481d3

Diffstat:
Mcollects/tests/scribble/main.ss | 17++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/collects/tests/scribble/main.ss b/collects/tests/scribble/main.ss @@ -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))) + )