summaryrefslogtreecommitdiff
path: root/test/run.scm
diff options
context:
space:
mode:
Diffstat (limited to 'test/run.scm')
-rw-r--r--test/run.scm10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/run.scm b/test/run.scm
index 38d28de..91d57ca 100644
--- a/test/run.scm
+++ b/test/run.scm
@@ -178,10 +178,14 @@
(point->y p))))
(test-assert "should not be able to mutate immutable record fields using json-object-set!"
- (guard (_ (else #t))
+ (guard (e ((or (eq? e 'could-mutate)
+ (eq? e 'no-error)) #f)
+ (else #t))
(let ((p (point 1 2)))
- (json-object-set! p 'x #f)
- (point->x p))))
+ (set! p (json-object-set! p 'x #f))
+ (if (not (point->x p))
+ (raise 'could-mutate)
+ (raise 'no-error)))))
(test-assert "(json (object)) should meet the record predicate with only the correct keys"
(point? (json