We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91dd867 commit 6c318f5Copy full SHA for 6c318f5
test/clojure/test_clojure/reducers.clj
@@ -61,3 +61,13 @@
61
(deftest test-nil
62
(is (= {:k :v} (reduce-kv assoc {:k :v} nil)))
63
(is (= 0 (r/fold + nil))))
64
+
65
+(deftest test-fold-runtime-exception
66
+ (is (thrown? IndexOutOfBoundsException
67
+ (let [test-map-count 1234
68
+ k-fail (rand-int test-map-count)]
69
+ (r/fold (fn ([])
70
+ ([ret [k v]])
71
+ ([ret k v] (when (= k k-fail)
72
+ (throw (IndexOutOfBoundsException.)))))
73
+ (zipmap (range test-map-count) (repeat :dummy)))))))
0 commit comments