From a792bd280110e961e9c6b3e78ecd386d637db3dc Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Fri, 17 Feb 2023 15:23:21 -0500 Subject: Add a test to make sure that specialize string to record raises an error when it should --- test/run.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test') 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)) -- cgit