Commits

Moritz Heidkamp  committed a44d579

Add parser-input tests

  • Participants
  • Parent commits 2eb9de9

Comments (0)

Files changed (1)

File tests/run.scm

   (test "ok\\" (parse singly-quoted-bang-string "'ok\\'"))
   (test-assert (not (parse singly-quoted-bang-string "\"check\""))))
 
+(test-group "parser-input"
+  (receive (x rest)
+    (parse item "foo")
+    (test #\f x)
+    (test-assert (parser-input? rest))
+    (test-assert (not (parser-input-end? rest)))
+    (test "oo" (parser-input->string rest))
+    (test (list #\o #\o) (parser-input->list rest))
+    (receive (x* rest*)
+      (parse (as-string (sequence item item)) rest)
+      (test "oo" x*)
+      (test-assert (parser-input-end? rest*)))))
+
 (test-end)
 
 (test-exit)