Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/clojure/core_test/group_by.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
(let [g (group-by first [[^:foo [1] [2]] [^:bar [1] [3]]])]
(is (= {[1] [[[1] [2]] [[1] [3]]]} g))
;; Metadata should be preserved on grouped items
(is (= {:foo true} (-> g (get [1]) first first meta)))
(is (= {:bar true} (-> g (get [1]) second first meta))))
(is (true? (-> g (get [1]) first first meta :foo)))
(is (true? (-> g (get [1]) second first meta :bar))))

;; Metadata should also be preserved on items and items should
;; stay in the order of the initial collection
Expand All @@ -34,7 +34,7 @@
;; validate order of items in each grouping using attached
;; metadata, which also validates that metadata is preserved
;; on items
(is (= {:a true} (-> s (get true) first meta)))
(is (= {:c true} (-> s (get true) second meta)))
(is (= {:b true} (-> s (get false) first meta)))
(is (= {:d true} (-> s (get false) second meta))))))))
(is (true? (-> s (get true) first meta :a)))
(is (true? (-> s (get true) second meta :c)))
(is (true? (-> s (get false) first meta :b)))
(is (true? (-> s (get false) second meta :d))))))))
Loading