From c4f40b59f1305794c832976fe5a2f4b46fc4dc57 Mon Sep 17 00:00:00 2001 From: Francisco Maxwell Date: Thu, 24 Sep 2026 23:13:33 -0300 Subject: [PATCH] Fix abbreviation output for predicate mismatches --- src/cljc/matcher_combinators/printer.cljc | 4 +++- test/clj/matcher_combinators/config_test.clj | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/cljc/matcher_combinators/printer.cljc b/src/cljc/matcher_combinators/printer.cljc index 02f241a..0da2c24 100644 --- a/src/cljc/matcher_combinators/printer.cljc +++ b/src/cljc/matcher_combinators/printer.cljc @@ -69,7 +69,9 @@ (colorized-print markup) (pprint/simple-dispatch markup)))) -(defrecord EllisionMarker []) +(defrecord EllisionMarker [] + #?@(:clj [Comparable + (compareTo [_ _] 1)])) (defmethod markup-expression EllisionMarker [_] '...) (def ellision-marker (EllisionMarker.)) diff --git a/test/clj/matcher_combinators/config_test.clj b/test/clj/matcher_combinators/config_test.clj index 9296d39..5e4630f 100644 --- a/test/clj/matcher_combinators/config_test.clj +++ b/test/clj/matcher_combinators/config_test.clj @@ -63,3 +63,12 @@ (:matcher-combinators.result/value (c/match [#{2}] [#{1 2}]))))) (config/disable-abbreviation!)) + +(deftest abbreviated-predicate-mismatch-output-test + (config/enable-abbreviation!) + (is (string? + (printer/as-string + (:matcher-combinators.result/value + (c/match {:a list?} + {:a (into [] (repeat 400 :a))}))))) + (config/disable-abbreviation!))