Skip to content

Commit 1b5bc33

Browse files
r0manbbatsov
authored andcommitted
Add util test
1 parent 66d7ee6 commit 1b5bc33

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/haystack/parser/util_test.clj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(ns haystack.parser.util-test
2+
(:require
3+
[clojure.test :refer [deftest is]]
4+
[haystack.parser.util :as util]))
5+
6+
(deftest safe-read-edn-test
7+
(is (= nil (util/safe-read-edn "[")))
8+
(is (= [1 2 3] (util/safe-read-edn "[1 2 3]")))
9+
(let [{:keys [form tag]} (util/safe-read-edn "#error {:a 1}")]
10+
(is (= 'error tag))
11+
(is (= {:a 1} form))))

0 commit comments

Comments
 (0)