From 33d593297dffa327230c87ea0de9499226b1a4b6 Mon Sep 17 00:00:00 2001 From: Paula Gearon Date: Mon, 27 Nov 2023 12:27:08 -0500 Subject: [PATCH] Restricted iterator tests to JVM --- test/tiara/data_test.cljc | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/test/tiara/data_test.cljc b/test/tiara/data_test.cljc index 67c6827..b71988f 100644 --- a/test/tiara/data_test.cljc +++ b/test/tiara/data_test.cljc @@ -35,19 +35,21 @@ (is (= (seq (apply array-map (make-kv-range 20))) (seq (apply ordered-map (make-kv-range 20))))))) -(defn- drain-iterable - "Similar to iterator-seq, without chunking" - [i] - (let [^java.util.Iterator it (.iterator ^Iterable i)] - (loop [v []] - (if (.hasNext it) - (recur (conj v (.next it))) - v)))) - -(deftest test-iterable - (testing "Testing the iterable interface" - (is (= [] (drain-iterable (ordered-map)))) - (is (= [[:a 1] [:b 2]] (drain-iterable (ordered-map :a 1 :b 2)))))) +#?(:clj + (defn- drain-iterable + "Similar to iterator-seq, without chunking" + [i] + (let [^java.util.Iterator it (.iterator ^Iterable i)] + (loop [v []] + (if (.hasNext it) + (recur (conj v (.next it))) + v))))) + +#?(:clj + (deftest test-iterable + (testing "Testing the iterable interface" + (is (= [] (drain-iterable (ordered-map)))) + (is (= [[:a 1] [:b 2]] (drain-iterable (ordered-map :a 1 :b 2))))))) (deftest test-assoc (testing "equivalence of maps constructed using assoc"