summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Zambito <contact@robbyzambito.me>2023-02-17 15:23:21 -0500
committerRobby Zambito <contact@robbyzambito.me>2023-02-17 15:23:21 -0500
commita792bd280110e961e9c6b3e78ecd386d637db3dc (patch)
treefc63fdf9112ce3a168138b844feebf96e29f7977
parent490ba21f6594fcfe0187cd6c1f7c37141f77cc93 (diff)
Add a test to make sure that specialize string to record raises an error when it should
-rw-r--r--test/run.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/run.scm b/test/run.scm
index f3d63dc..6d72f46 100644
--- a/test/run.scm
+++ b/test/run.scm
@@ -63,16 +63,16 @@
(json-null? (string->json "null")))
(test-equal "numbers should parse to their scheme values"
- 5 (string->json "5"))
+ 5 (string->json "5"))
(test-equal "true should parse to the boolean true"
- #t (string->json "true"))
+ #t (string->json "true"))
(test-equal "false should parse to the boolean false"
- #f (string->json "false"))
+ #f (string->json "false"))
(test-equal "string->json should properly parse string values"
- "hello" (string->json "\"hello\""))
+ "hello" (string->json "\"hello\""))
(test-assert "string->json should return an object with the correct keys"
(json-object-contains-key? (string->json "{\"x\": 5}") 'x))
@@ -250,3 +250,7 @@
(and (three-d-point? tdp2)
(not (point? tdp2)))))
+(test-assert "the string to record converter should raise an exception if there are missing keys"
+ (guard (_ (else #t))
+ (string->point "{\"x\": 5}")
+ #f))