From 48d6128985d7e41591ed41b79065fd25725c3bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20V=C3=A4is=C3=A4nen?= Date: Sat, 23 Sep 2023 21:53:39 +0300 Subject: [PATCH] Fix string min/max description strings closes #924 --- src/malli/experimental/describe.cljc | 4 ++-- test/malli/experimental/describe_test.cljc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/malli/experimental/describe.cljc b/src/malli/experimental/describe.cljc index 81c1e0504..6c6cbc5e6 100644 --- a/src/malli/experimental/describe.cljc +++ b/src/malli/experimental/describe.cljc @@ -21,8 +21,8 @@ (let [{:keys [min max]} (-> schema m/properties)] (cond (and min max) (str " with length between " min " and " max " inclusive") - min (str " with length <= " min) - max (str " with length >= " max) + min (str " with length >= " min) + max (str " with length <= " max) :else ""))) (defn -pluralize-times [n] diff --git a/test/malli/experimental/describe_test.cljc b/test/malli/experimental/describe_test.cljc index 0662367cb..5d1e24576 100644 --- a/test/malli/experimental/describe_test.cljc +++ b/test/malli/experimental/describe_test.cljc @@ -8,8 +8,8 @@ (is (= "vector of integer" (med/describe [:vector :int])))) (testing "string" - (is (= "string with length <= 5" (med/describe [:string {:min 5}]))) - (is (= "string with length >= 5" (med/describe [:string {:max 5}]))) + (is (= "string with length >= 5" (med/describe [:string {:min 5}]))) + (is (= "string with length <= 5" (med/describe [:string {:max 5}]))) (is (= "string with length between 3 and 5 inclusive" (med/describe [:string {:min 3 :max 5}])))) (testing "function"