mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
add Clojure and its dialects to /samples
This commit is contained in:
20
samples/Clojure/unit-test.cl2
Normal file
20
samples/Clojure/unit-test.cl2
Normal file
@@ -0,0 +1,20 @@
|
||||
(deftest function-tests
|
||||
(is (= 3
|
||||
(count [1 2 3])))
|
||||
(is (= false
|
||||
(not true)))
|
||||
(is (= true
|
||||
(contains? {:foo 1 :bar 2} :foo)))
|
||||
|
||||
(is (= {"foo" 1, "baz" 3}
|
||||
(select-keys {:foo 1 :bar 2 :baz 3} [:foo :baz])))
|
||||
|
||||
(is (= [1 2 3]
|
||||
(vals {:foo 1 :bar 2 :baz 3})))
|
||||
|
||||
(is (= ["foo" "bar" "baz"]
|
||||
(keys {:foo 1 :bar 2 :baz 3})))
|
||||
|
||||
(is (= [2 4 6]
|
||||
(filter (fn [x] (=== (rem x 2) 0)) [1 2 3 4 5 6]))))
|
||||
|
||||
Reference in New Issue
Block a user