diff options
Diffstat (limited to 'test/run.scm')
-rw-r--r-- | test/run.scm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/run.scm b/test/run.scm index 91d57ca..b3020c5 100644 --- a/test/run.scm +++ b/test/run.scm @@ -168,9 +168,20 @@ (test-equal "record mutator should mutate the record instance" 3 (let ((p (point 1 2))) - (set! p (point-set-y! p 3)) + (point-set-y! p 3) (point->y p))) +(test-equal "json-object->alist should return the correct values after mutating the record" + 3 + (let ((p (point 1 2))) + (point-set-y! p 3) + (cdr (assoc 'y (json-object->alist p))))) + +(test-equal "should be able to reference record fields with json-object-ref" + 2 + (let ((p (point 1 2))) + (json-object-ref p 'y))) + (test-assert "should be able to mutate mutable record fields using json-object-set!" (guard (_ (else #f)) (let ((p (point 1 2))) |