fix ALL on regular lists from reversing order

This commit is contained in:
Nathan Marz 2015-03-01 20:33:42 -05:00
parent d845924088
commit 97086068d6
2 changed files with 14 additions and 4 deletions

View file

@ -142,9 +142,12 @@
(select* [this vals structure next-fn] (select* [this vals structure next-fn]
(into [] (r/mapcat (partial next-fn vals) structure))) (into [] (r/mapcat (partial next-fn vals) structure)))
(update* [this vals structure next-fn] (update* [this vals structure next-fn]
(let [ret (r/map (partial next-fn vals) structure)] (let [ret (r/map (partial next-fn vals) structure)
(into (empty structure) ret)) res (into (empty structure) ret)]
)) (if (list? structure)
(reverse res)
res
))))
(deftype ValStructurePath [] (deftype ValStructurePath []
StructurePath StructurePath

View file

@ -68,7 +68,14 @@
(for-all+ (for-all+
[v (gen/vector gen/int)] [v (gen/vector gen/int)]
(let [v2 (update [ALL] inc v)] (let [v2 (update [ALL] inc v)]
(= v2 (map inc v)) (and (vector? v2) (= v2 (map inc v)))
)))
(defspec update-all-list
(for-all+
[v (gen/list gen/int)]
(let [v2 (update [ALL] inc v)]
(and (list? v2) (= v2 (map inc v)))
))) )))
(defspec update-all-filter (defspec update-all-filter