Skip to content

Commit

Permalink
* test/cljs/cljs/core_test.cljs: tests for instance?, test for namesp…
Browse files Browse the repository at this point in the history
…aced keyword
  • Loading branch information
swannodette committed Nov 13, 2011
1 parent 0c24089 commit eef807e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/cljs/cljs/core_test.cljs
Expand Up @@ -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)
1 change: 1 addition & 0 deletions test/cljs/cljs/reader_test.cljs
Expand Up @@ -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")))
Expand Down

0 comments on commit eef807e

Please sign in to comment.