Permalink
Browse files

CLJS-468 Test reduce-kv and fold with nil

  • Loading branch information...
1 parent 0b3187f commit e1e14cb2e0437fae2ba5e5c194b1b3e8d2f23b59 @bendlas bendlas committed with swannodette Feb 28, 2013
Showing with 13 additions and 1 deletion.
  1. +1 −0 test/cljs/cljs/core_test.cljs
  2. +9 −0 test/cljs/cljs/reducers_test.cljs
  3. +3 −1 test/cljs/test_runner.cljs
@@ -1796,6 +1796,7 @@
(kvr-test (hash-map :k0 :v0 :k1 :v1) [:k0 :v0 :k1 :v1])
(kvr-test (array-map :k0 :v0 :k1 :v1) [:k0 :v0 :k1 :v1])
(kvr-test [:v0 :v1] [0 :v0 1 :v1]))
+ (assert (= {:init :val} (reduce-kv assoc {:init :val} nil)))
;; data conveying exception
(assert (= {:foo 1}
@@ -0,0 +1,9 @@
+(ns cljs.reducers-test
+ (:require
+ [clojure.core.reducers :as r]))
+
+(defn test-builtin-impls []
+ (assert (= 0 (r/fold + nil))))
+
+(defn test-all []
+ (test-builtin-impls))
@@ -8,7 +8,8 @@
[cljs.macro-test :as macro-test]
[cljs.letfn-test :as letfn-test]
[foo.ns-shadow-test :as ns-shadow-test]
- [cljs.top-level :as top-level]))
+ [cljs.top-level :as top-level]
+ [cljs.reducers-test :as reducers-test]))
(set! *print-fn* js/print)
@@ -22,6 +23,7 @@
(letfn-test/test-letfn)
(ns-shadow-test/test-shadow)
(top-level/test)
+(reducers-test/test-all)
(println "Tests completed without exception")

0 comments on commit e1e14cb

Please sign in to comment.