~ chicken-core (chicken-5) e2406838f3c5a5448c943d7e406149abb4e5daaf
commit e2406838f3c5a5448c943d7e406149abb4e5daaf Author: felix <felix@call-with-current-continuation.org> AuthorDate: Fri Apr 8 01:15:42 2011 -0400 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Fri Apr 8 01:15:42 2011 -0400 forgot to add test file (thanks to Kon) diff --git a/tests/pp-test.scm b/tests/pp-test.scm new file mode 100644 index 00000000..0de573c1 --- /dev/null +++ b/tests/pp-test.scm @@ -0,0 +1,14 @@ + +(define (pp->string thing) + (with-output-to-string (cut pp thing))) + +(define-syntax test + (syntax-rules () + ((_ result exp) + (assert (equal? result exp))))) + +(test "\"\\\"foo\\\"\"\n" (pp->string "\"foo\"")) +(test "\"\\\\\\\"\"\n" (pp->string "\\\"")) +(test "\"\\\\\\\\\\\\\\\"\"\n" (pp->string "\\\\\\\"")) +(test "\"\\\"\\\"\\\"\"\n" (pp->string "\"\"\"")) +(test "\\" "\\")Trap