From eef807e577147fa40431844aec2f6c0778b8e789 Mon Sep 17 00:00:00 2001 From: David Nolen Date: Sun, 13 Nov 2011 18:25:34 -0500 Subject: [PATCH] * test/cljs/cljs/core_test.cljs: tests for instance?, test for namespaced keyword --- test/cljs/cljs/core_test.cljs | 9 +++++++++ test/cljs/cljs/reader_test.cljs | 1 + 2 files changed, 10 insertions(+) diff --git a/test/cljs/cljs/core_test.cljs b/test/cljs/cljs/core_test.cljs index 0155c9a..20f07d6 100644 --- a/test/cljs/cljs/core_test.cljs +++ b/test/cljs/cljs/core_test.cljs @@ -726,5 +726,14 @@ (assert (= (assoc fred :lastname "Flintstone") {:firstname "Fred" :lastname "Flintstone"})) (assert (= (assoc fred :wife :ethel) {:firstname "Fred" :lastname "Mertz" :wife :ethel})) (assert (= (dissoc ethel :husband) {:firstname "Ethel" :lastname "Mertz"})) + + (assert (instance? js/Object 1)) + (assert (instance? js/Number 1)) + (assert (instance? js/Object "foo")) + (assert (instance? js/String "foo")) + (assert (instance? js/Object (array))) + (assert (instance? js/Array (array))) + (assert (instance? js/Object (fn []))) + (assert (instance? js/Function (fn []))) :ok) diff --git a/test/cljs/cljs/reader_test.cljs b/test/cljs/cljs/reader_test.cljs index dbfb90b..a99aa1c 100644 --- a/test/cljs/cljs/reader_test.cljs +++ b/test/cljs/cljs/reader_test.cljs @@ -19,6 +19,7 @@ (assert (= {:tag 'String} (meta (reader/read-string "^String {:a 1}")))) (assert (= [:a 'b #{'c {:d [:e :f :g]}}] (reader/read-string "[:a b #{c {:d [:e :f :g]}}]"))) + (assert (= :foo/bar (reader/read-string ":foo/bar"))) (assert (= nil (reader/read-string "nil"))) (assert (= true (reader/read-string "true"))) (assert (= false (reader/read-string "false")))