File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ (ns clojure.core-test.pop
2+ (:require [clojure.test :as t :refer [deftest testing is are]]
3+ [clojure.core-test.portability #?(:cljs :refer-macros :default :refer ) [when-var-exists ]]))
4+
5+ (when-var-exists pop
6+ (deftest test-pop
7+ (testing " common"
8+ (is (= nil (pop nil )))
9+ (is (= '(nil ) (pop '(nil nil ))))
10+ (is (= [1 2 ] (pop [1 2 3 ])))
11+ (is (= [1 2 ] (pop [1 2 (range )])))
12+ (is (= '(2 3 ) (pop '(1 2 3 ))))
13+ (is (= '(2 3 ) (pop '((range ) 2 3 ))))
14+ #?@(:cljs [(is (thrown? js/Error (pop \space)))
15+ (is (thrown? js/Error (pop 0 )))
16+ (is (thrown? js/Error (pop 0.0 )))
17+ (is (thrown? js/Error (pop [])))
18+ (is (thrown? js/Error (pop '())))
19+ (is (thrown? js/Error (pop {})))]
20+ :default [(is (thrown? Exception (pop 0 )))
21+ (is (thrown? Exception (pop 0.0 )))
22+ (is (thrown? Exception (pop \space)))
23+ (is (thrown? Exception (pop [])))
24+ (is (thrown? Exception (pop '())))
25+ (is (thrown? Exception (pop {})))]))))
You can’t perform that action at this time.
0 commit comments