File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
test/clojure/test_clojure Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 8080 [map kmap]
8181 (reduce
8282 (fn [m [old new]]
83- (if (and (not= old new)
84- (contains? m old))
85- (-> m (assoc new (get m old)) (dissoc old))
83+ (if (contains? map old)
84+ (assoc m new (get map old))
8685 m))
87- map kmap))
86+ ( apply dissoc map ( keys kmap)) kmap))
8887
8988(defn rename
9089 " Returns a rel of the maps in xrel with the keys in kmap renamed to the vals in kmap"
Original file line number Diff line number Diff line change 162162
163163(deftest test-rename-keys
164164 (are [x y] (= x y)
165- (set/rename-keys {:a " one" :b " two" } {:a :z }) {:z " one" :b " two" }
166- ))
165+ (set/rename-keys {:a " one" :b " two" } {:a :z }) {:z " one" :b " two" }
166+ (set/rename-keys {:a " one" :b " two" } {:a :z :c :y }) {:z " one" :b " two" }
167+ (set/rename-keys {:a " one" :b " two" :c " three" } {:a :b :b :a }) {:a " two" :b " one" :c " three" }))
167168
168169(deftest test-index
169170 (are [x y] (= x y)
You can’t perform that action at this time.
0 commit comments