Add tests for the empty keyword
I have some macros for using pandas and NumPy that expect : to be a keyword instead of an ordinary symbol. These tests will ensure that we don't break this unless we want to.
This commit is contained in:
parent
13b484ce46
commit
a4158c5543
@ -1047,6 +1047,19 @@
|
|||||||
(assert (= (get {:foo "bar" ":foo" "quux"} :foo) "bar"))
|
(assert (= (get {:foo "bar" ":foo" "quux"} :foo) "bar"))
|
||||||
(assert (= (get {:foo "bar" ":foo" "quux"} ":foo") "quux")))
|
(assert (= (get {:foo "bar" ":foo" "quux"} ":foo") "quux")))
|
||||||
|
|
||||||
|
|
||||||
|
(defn test-empty-keyword []
|
||||||
|
"NATIVE: test that the empty keyword is recognized"
|
||||||
|
(assert (= : :))
|
||||||
|
(assert (keyword? :))
|
||||||
|
(assert (!= : ":"))
|
||||||
|
(assert (= (name :) ""))
|
||||||
|
|
||||||
|
(defn f [&kwargs kwargs]
|
||||||
|
(list (.items kwargs)))
|
||||||
|
(assert (= (f : 3) [(, "" 3)])))
|
||||||
|
|
||||||
|
|
||||||
(defn test-nested-if []
|
(defn test-nested-if []
|
||||||
"NATIVE: test nested if"
|
"NATIVE: test nested if"
|
||||||
(for [x (range 10)]
|
(for [x (range 10)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user