Skip to content

Commit 78584d2

Browse files
yuhan0bbatsov
authored andcommitted
Add comma before ... in ,-separated colls
1 parent 946320d commit 78584d2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/orchard/inspect.clj

+2-2
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
(safe-pr-seq value ", " "{ %s }"))
242242

243243
(defmethod inspect-value :map-long [value]
244-
(safe-pr-seq (take *max-coll-size* value) ", " "{ %s ... }"))
244+
(safe-pr-seq (take *max-coll-size* value) ", " "{ %s, ... }"))
245245

246246
(defmethod inspect-value :vector [value]
247247
(safe-pr-seq value "[ %s ]"))
@@ -274,7 +274,7 @@
274274

275275
(defmethod inspect-value :array-long [value]
276276
(let [ct (.getName (or (.getComponentType (class value)) Object))]
277-
(safe-pr-seq (take *max-coll-size* value) ", " (str ct "[] { %s ... }"))))
277+
(safe-pr-seq (take *max-coll-size* value) ", " (str ct "[] { %s, ... }"))))
278278
(defmethod inspect-value java.lang.Class [value]
279279
(pr-str value))
280280

test/orchard/inspect_test.clj

+6-6
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,13 @@
259259
"#{ :a }" #{:a}
260260
"( 1 1 1 1 1 ... )" (repeat 1)
261261
"[ ( 1 1 1 1 1 ... ) ]" [(repeat 1)]
262-
"{ :a { ( 0 1 2 3 4 ... ) 1, 2 3, 4 5, 6 7, 8 9 ... } }" {:a {(range 10) 1, 2 3, 4 5, 6 7, 8 9, 10 11}}
262+
"{ :a { ( 0 1 2 3 4 ... ) 1, 2 3, 4 5, 6 7, 8 9, ... } }" {:a {(range 10) 1, 2 3, 4 5, 6 7, 8 9, 10 11}}
263263
"( 1 2 3 )" (lazy-seq '(1 2 3))
264264
"( 1 1 1 1 1 ... )" (java.util.ArrayList. (repeat 100 1))
265265
"( 1 2 3 )" (java.util.ArrayList. [1 2 3])
266266
"{ :a 1, :b 2 }" (java.util.HashMap. {:a 1 :b 2})
267267
"long[] { 1, 2, 3, 4 }" (long-array [1 2 3 4])
268-
"java.lang.Long[] { 0, 1, 2, 3, 4 ... }" (into-array Long (range 10))
268+
"java.lang.Long[] { 0, 1, 2, 3, 4, ... }" (into-array Long (range 10))
269269
"#<MyTestType test1>" (MyTestType. "test1")))
270270

271271
(testing "inspect-value adjust length and size"
@@ -279,12 +279,12 @@
279279
"( :a :b )" '(:a :b)
280280
"[ 1 2 ... ]" [1 2 3]
281281
"{ :a 1, :b 2 }" {:a 1 :b 2}
282-
"{ :a 1, :b 2 ... }" {:a 1 :b 2 :c 3}
283-
"{ :a 1, :b 2 ... }" (sorted-map :d 4 :b 2 :a 1 :c 3)
282+
"{ :a 1, :b 2, ... }" {:a 1 :b 2 :c 3}
283+
"{ :a 1, :b 2, ... }" (sorted-map :d 4 :b 2 :a 1 :c 3)
284284
"( 1 1 ... )" (repeat 1)
285285
"[ ( 1 1 ... ) ]" [(repeat 1)]
286-
"{ :a { ( 0 1 ... ) \"ab..., 2 3 ... } }" {:a {(range 10) "abcdefg", 2 3, 4 5, 6 7, 8 9, 10 11}}
287-
"java.lang.Long[] { 0, 1 ... }" (into-array Long (range 10))))
286+
"{ :a { ( 0 1 ... ) \"ab..., 2 3, ... } }" {:a {(range 10) "abcdefg", 2 3, 4 5, 6 7, 8 9, 10 11}}
287+
"java.lang.Long[] { 0, 1, ... }" (into-array Long (range 10))))
288288
(binding [inspect/*max-coll-size* 6]
289289
(are [result form] (= result (inspect/inspect-value form))
290290
"[ ( 1 1 1 1 1 1 ... ) ]" [(repeat 1)]

0 commit comments

Comments
 (0)