aboutsummaryrefslogtreecommitdiffstats
path: root/csc/format-test.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-07-26 19:24:10 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-07-26 19:24:10 -0700
commitbecfaeb778a3c8ba241e2155b998d6b27dcfad0c (patch)
tree97ca02178660fe958026a707905eac1c5ebd188d /csc/format-test.csc
parentb8ed2e52cd7decd56b195df5363fcc0f17cc3805 (diff)
downloadchromatopelma-becfaeb778a3c8ba241e2155b998d6b27dcfad0c.tar.zst
Fix a potential R7RS issue.
I was using the load procedure to load a program, but by a strict reading of R7RS, load can only handle expressions and definitions, not imports. So instead I'm defining each test as a library, and using the environment procedure to load them at runtime.
Diffstat (limited to 'csc/format-test.csc')
-rw-r--r--csc/format-test.csc30
1 files changed, 16 insertions, 14 deletions
diff --git a/csc/format-test.csc b/csc/format-test.csc
index 6efaa87..1906af6 100644
--- a/csc/format-test.csc
+++ b/csc/format-test.csc
@@ -1,24 +1,26 @@
-(import (scheme base)
- (only (csc strings) str-quote)
- (only (csc testing) assert-equal test)
- (csc format))
+(define-library (csc format-test)
+ (import (scheme base)
+ (only (csc strings) str-quote)
+ (only (csc testing) assert-equal test)
+ (csc format))
+ (begin
-(test sprintf-single-string
- (assert-equal "test-string" (sprintf "test-string")))
+ (test sprintf-single-string
+ (assert-equal "test-string" (sprintf "test-string")))
-(test sprintf-list
- (assert-equal "(1 2 3)" (sprintf "{}" '(1 2 3))))
+ (test sprintf-list
+ (assert-equal "(1 2 3)" (sprintf "{}" '(1 2 3))))
-(test sprintf-complex
- (assert-equal "this (1 2 3) is 1 a bbb test" (sprintf "this {} is {} a {} test" '(1 2 3) 1 "bbb")))
+ (test sprintf-complex
+ (assert-equal "this (1 2 3) is 1 a bbb test" (sprintf "this {} is {} a {} test" '(1 2 3) 1 "bbb")))
-(test sprintf-escape-open
- (assert-equal "{" (sprintf "{{")))
+ (test sprintf-escape-open
+ (assert-equal "{" (sprintf "{{")))
-(test sprintf-escape-close
- (assert-equal "}" (sprintf "}}")))
+ (test sprintf-escape-close
+ (assert-equal "}" (sprintf "}}")))))