Skip to content

Commit fc4ee45

Browse files
[test] Don't turn records into maps when post-processing test results
1 parent 7f8ee3b commit fc4ee45

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/cider/nrepl/middleware/test.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
(try
7979
(walk/postwalk
8080
(fn [x]
81-
(if (map? x)
81+
(if (and (map? x) (not (record? x))) ;; Prevent records turning into maps
8282
(with-meta (into (sorted-map) x) (meta x))
8383
x))
8484
m)

test/clj/cider/nrepl/middleware/test_test.clj

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
[clojure.string :as string]
77
[clojure.test :refer :all]
88
[matcher-combinators.clj-test]
9-
[matcher-combinators.matchers :as matchers])
9+
[matcher-combinators.matchers :as matchers]
10+
[matcher-combinators.model])
1011
(:import
1112
(clojure.lang ExceptionInfo)))
1213

@@ -199,10 +200,10 @@
199200

200201
(deftest print-object-test
201202
(testing "uses println for matcher-combinators results, otherwise invokes pprint"
202-
(is (= "{no quotes}\n"
203+
(is (= "(mismatch (expected [33m1[0m) (actual [31m2[0m))\n"
203204
(#'test/print-object (matcher-combinators.clj-test/tagged-for-pretty-printing
204205
'(not (match? 1 2))
205-
{:matcher-combinators.result/value {"no" "quotes"}})))
206+
{:matcher-combinators.result/value (matcher-combinators.model/->Mismatch "1" "2")})))
206207
"println is chosen, as indicated by strings printed without quotes")
207208
(is (= "{:a\n (\"a-sufficiently-long-string\"\n \"a-sufficiently-long-string\"\n \"a-sufficiently-long-string\")}\n"
208209
(#'test/print-object {:a (repeat 3 "a-sufficiently-long-string")}))

0 commit comments

Comments
 (0)