# HG changeset patch
# User Steve Losh <steve@stevelosh.com>
# Date 1597203907 14400
# Node ID ed56ff3ab22444c6b66221ec434c2b54340327b6
# Parent  b8a38e34e8406d5c7d6524dcc83a1b874c0b242d
Add simple test for multiple objects in a stream

diff -r b8a38e34e840 -r ed56ff3ab224 .TODO.done
--- a/.TODO.done	Tue Aug 11 23:27:35 2020 -0400
+++ b/.TODO.done	Tue Aug 11 23:45:07 2020 -0400
@@ -0,0 +1,1 @@
+Add basic unit tests | id:ed372a368fce619ce8230043635de5258212f607
diff -r b8a38e34e840 -r ed56ff3ab224 TODO
--- a/TODO	Tue Aug 11 23:27:35 2020 -0400
+++ b/TODO	Tue Aug 11 23:45:07 2020 -0400
@@ -6,4 +6,3 @@
 Add dynamic extent wrapper definition | id:a937f1179ff1fac77ca501ce7c70449464411f58
 Add fuzz tests against other implementations | id:cd53968480f72453ee820d65a180efe6da0fef71
 Add extra key preservation | id:cfb63b37d87893083fc98477ec3d488fb909a984
-Add basic unit tests | id:ed372a368fce619ce8230043635de5258212f607
diff -r b8a38e34e840 -r ed56ff3ab224 test/tests.lisp
--- a/test/tests.lisp	Tue Aug 11 23:27:35 2020 -0400
+++ b/test/tests.lisp	Tue Aug 11 23:45:07 2020 -0400
@@ -127,6 +127,17 @@
   (#(1 2 3 4 5) "  [  1,    2   ,3,    4,5]"))
 
 
+(define-test multiple-objects
+  (with-input-from-string (s (json "{} 1 2 [true, false] {'foo': null}"))
+    (is (same (h) (jarl:read t s)))
+    (is (same 1 (jarl:read t s)))
+    (is (same 2 (jarl:read t s)))
+    (is (same #(:true :false) (jarl:read t s)))
+    (is (same (h "foo" nil) (jarl:read t s)))
+    (is (eql :eof (jarl:read t s nil :eof)))
+    (signals end-of-file (jarl:read t s))))
+
+
 ;;;; Real-World Data ----------------------------------------------------------
 (defmacro define-file-test (name (object path) &body body)
   `(define-test ,name