diff --git a/src/net/cgrand/xforms.cljc b/src/net/cgrand/xforms.cljc index d6b785e..6bea491 100644 --- a/src/net/cgrand/xforms.cljc +++ b/src/net/cgrand/xforms.cljc @@ -483,7 +483,9 @@ (let [acc (rf nil (.next src-iterator))] (when (reduced? acc) (vreset! vopen false)) (recur)) - false))] + (do + (rf nil) + false)))] (reify java.util.Iterator (hasNext [_] (ensure-next)) diff --git a/test/net/cgrand/xforms_test.cljc b/test/net/cgrand/xforms_test.cljc index dac5d51..9e6d0c7 100644 --- a/test/net/cgrand/xforms_test.cljc +++ b/test/net/cgrand/xforms_test.cljc @@ -91,6 +91,9 @@ [[[0 1] [2 3] [4 5] [6 7]]]))) #?(:clj + (deftest iterator + (is (= [[0 1] [1 2] [2 3] [3 4] [4]] (iterator-seq (x/iterator (x/partition 2 1 nil) (.iterator (range 5))))))) + (deftest window-by-time (is (= (into []