Fix some reflection warnings seen in tests

This commit is contained in:
Imre Kószó 2022-07-31 15:13:33 +02:00
parent 891a7f98ba
commit 86d9ef14f1
2 changed files with 5 additions and 5 deletions

View file

@ -556,7 +556,7 @@
"Iterator transducing context, returns an iterator on the transformed data. "Iterator transducing context, returns an iterator on the transformed data.
Equivalent to (.iterator (eduction xform (iterator-seq src-iterator))) except there's is no buffering on values (as in iterator-seq), Equivalent to (.iterator (eduction xform (iterator-seq src-iterator))) except there's is no buffering on values (as in iterator-seq),
This buffering may cause problems when mutable objects are returned by the src-iterator." This buffering may cause problems when mutable objects are returned by the src-iterator."
[xform ^java.util.Iterator src-iterator] ^java.util.Iterator [xform ^java.util.Iterator src-iterator]
(let [NULL (Object.) (let [NULL (Object.)
dq (java.util.ArrayDeque. 32) dq (java.util.ArrayDeque. 32)
rf (xform (fn ([acc] acc) ([acc x] (.push dq (if (some? x) x NULL)) acc))) rf (xform (fn ([acc] acc) ([acc x] (.push dq (if (some? x) x NULL)) acc)))

View file

@ -1,6 +1,6 @@
(ns net.cgrand.xforms-test (ns net.cgrand.xforms-test
(:refer-clojure :exclude [partition reductions]) (:refer-clojure :exclude [partition reductions])
(:require [clojure.test :refer [is deftest testing]] (:require [clojure.test :refer [are is deftest testing]]
[net.cgrand.xforms :as x])) [net.cgrand.xforms :as x]))
(defn trial (defn trial
@ -97,9 +97,9 @@
#?(:clj #?(:clj
(deftest iterator (deftest iterator
(is (true? (.hasNext (x/iterator x/count (.iterator (range 5)))))) (is (true? (.hasNext (x/iterator x/count (.iterator ^java.lang.Iterable (range 5))))))
(is (is (= [5] (iterator-seq (x/iterator x/count (.iterator (range 5))))))) (is (is (= [5] (iterator-seq (x/iterator x/count (.iterator ^java.lang.Iterable (range 5)))))))
(is (= [[0 1] [1 2] [2 3] [3 4] [4]] (iterator-seq (x/iterator (x/partition 2 1 nil) (.iterator (range 5))))))) (is (= [[0 1] [1 2] [2 3] [3 4] [4]] (iterator-seq (x/iterator (x/partition 2 1 nil) (.iterator ^java.lang.Iterable (range 5)))))))
(deftest window-by-time (deftest window-by-time
(is (= (into (is (= (into