From 25cb16dfe411a9bd9d9d279d2476ec3dfc0a7595 Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Mon, 20 Feb 2023 23:46:18 -0500 Subject: Reach feature parity with Sagittarius --- test/run.scm | 12 +++++------- test/sagittarius.scm | 10 ++++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 test/sagittarius.scm (limited to 'test') diff --git a/test/run.scm b/test/run.scm index 416c0f4..d0b0e27 100644 --- a/test/run.scm +++ b/test/run.scm @@ -120,7 +120,7 @@ (test-equal "should be able to mutate the value of a field using json-object-set!" 1 (let ((p (json-object '(x . 5)))) - (json-object-set! p 'x 1) + (set! p (json-object-set! p 'x 1)) (json-ref p 'x))) ;; json macro tests @@ -174,7 +174,7 @@ (test-assert "should be able to mutate mutable record fields using json-object-set!" (guard (_ (else #f)) (let ((p (point 1 2))) - (json-object-set! p 'y #t) + (set! p (json-object-set! p 'y #t)) (point->y p)))) (test-assert "should not be able to mutate immutable record fields using json-object-set!" @@ -217,11 +217,9 @@ (point? (line-segment->start ls)))) (test-assert "nested records should be able to round trip to a string" - (let* ((p1 (point 1 2)) - (p2 (point 3 4)) - (ls (line-segment p1 p2)) - (str (json->string ls)) - (res (string->line-segment str))) + (let* ((ls (line-segment (point 1 2) (point 3 4))) + (str (json->string ls)) + (res (string->line-segment str))) (and (line-segment? res) (point? (line-segment->start res))))) diff --git a/test/sagittarius.scm b/test/sagittarius.scm new file mode 100644 index 0000000..47aa1a2 --- /dev/null +++ b/test/sagittarius.scm @@ -0,0 +1,10 @@ +(import (scheme base) + (scheme case-lambda) + (srfi 64)) + +(import (zambyte meta json)) + +(test-begin "sagittarius") +(include "run.scm") +(test-end "sagittarius") + -- cgit