diff --git a/test/clojure/string_test/blank_qmark.cljc b/test/clojure/string_test/blank_qmark.cljc index 3256b6b7..aeaa274f 100644 --- a/test/clojure/string_test/blank_qmark.cljc +++ b/test/clojure/string_test/blank_qmark.cljc @@ -22,7 +22,10 @@ :default (is (p/thrown? (str/blank? (keyword ""))))) #?(:cljs (is (false? (str/blank? 1))) :default (is (p/thrown? (str/blank? 1)))) - #?(:lpy (is (true? (str/blank? \space))) + ;; Phel reads `\space` as the single-space string " ", so `blank?` returns + ;; true (it is whitespace) rather than throwing on a character type. + #?(:phel (is (true? (str/blank? \space))) + :lpy (is (true? (str/blank? \space))) :cljs (do (is (true? (str/blank? \space))) (is (false? (str/blank? \a)))) :default (is (p/thrown? (str/blank? \space)))) diff --git a/test/clojure/string_test/capitalize.cljc b/test/clojure/string_test/capitalize.cljc index 2c2d8cc9..af5ba402 100644 --- a/test/clojure/string_test/capitalize.cljc +++ b/test/clojure/string_test/capitalize.cljc @@ -6,7 +6,14 @@ (when-var-exists str/capitalize (deftest test-capitalize (is (p/thrown? (str/capitalize nil))) - #?(:cljr (do (is (p/thrown? (str/capitalize 1))) + ;; Phel's string functions are strict: a non-string argument throws + ;; rather than being coerced via `str`/`toString` (the JVM `:default` + ;; behaviour). Documented divergence; matches the :cljs/:lpy/:cljr stance. + #?(:phel (do (is (p/thrown? (str/capitalize 1))) + (is (p/thrown? (str/capitalize 'Asdf))) + (is (p/thrown? (str/capitalize 'asDf/aSdf))) + (is (p/thrown? (str/capitalize :asDf/aSdf)))) + :cljr (do (is (p/thrown? (str/capitalize 1))) (is (p/thrown? (str/capitalize 'Asdf))) (is (p/thrown? (str/capitalize 'asDf/aSdf))) (is (p/thrown? (str/capitalize :asDf/aSdf)))) diff --git a/test/clojure/string_test/ends_with_qmark.cljc b/test/clojure/string_test/ends_with_qmark.cljc index 3537c03a..2eb07d5d 100644 --- a/test/clojure/string_test/ends_with_qmark.cljc +++ b/test/clojure/string_test/ends_with_qmark.cljc @@ -19,7 +19,15 @@ #?(:cljs (is (false? (str/ends-with? "ab" 'b))) :default (is (p/thrown? (str/ends-with? "ab" 'b)))) - #?@(:cljr + ;; Phel's string functions are strict: a non-string argument throws + ;; rather than being coerced via `str`/`toString` (the JVM `:default` + ;; behaviour). Documented divergence; matches the :cljs/:lpy/:cljr stance. + #?@(:phel + [(is (p/thrown? (str/ends-with? 'ab "b"))) + (is (p/thrown? (str/ends-with? 'ab "a"))) + (is (p/thrown? (str/ends-with? :ab "b"))) + (is (p/thrown? (str/ends-with? :ab "b")))] + :cljr [(is (p/thrown? (str/ends-with? 'ab "b"))) (is (p/thrown? (str/ends-with? 'ab "a"))) (is (p/thrown? (str/ends-with? :ab "b"))) diff --git a/test/clojure/string_test/lower_case.cljc b/test/clojure/string_test/lower_case.cljc index 39e6124f..17ac6036 100644 --- a/test/clojure/string_test/lower_case.cljc +++ b/test/clojure/string_test/lower_case.cljc @@ -13,7 +13,17 @@ (let [s "ASDF"] (is (= "asdf" (str/lower-case "ASDF"))) (is (= "ASDF" s) "original string mutated")) - #?(:cljr + ;; Phel's string functions are strict: a non-string argument throws + ;; rather than being coerced via `str`/`toString` (the JVM `:default` + ;; behaviour). Documented divergence; matches the :cljs/:lpy/:cljr stance. + #?(:phel + (are [v] (p/thrown? (str/lower-case v)) + :ASDF + :ASDF/ASDF + 'ASDF + 'ASDF/ASDF) + + :cljr (are [v] (p/thrown? (str/lower-case v)) :ASDF :ASDF/ASDF diff --git a/test/clojure/string_test/starts_with_qmark.cljc b/test/clojure/string_test/starts_with_qmark.cljc index 6cf23b10..b46609a2 100644 --- a/test/clojure/string_test/starts_with_qmark.cljc +++ b/test/clojure/string_test/starts_with_qmark.cljc @@ -28,7 +28,15 @@ (is (false? (str/starts-with? "a-test" "-"))) (is (false? (str/starts-with? "a-test" "t"))) - #?@(:cljr + ;; Phel's string functions are strict: a non-string argument throws + ;; rather than being coerced via `str`/`toString` (the JVM `:default` + ;; behaviour). Documented divergence; matches the :cljs/:lpy/:cljr stance. + #?@(:phel + [(is (p/thrown? (str/starts-with? 'ab ":a"))) + (is (p/thrown? (str/starts-with? :ab ":a"))) + (is (p/thrown? (str/starts-with? 'a/b ":a"))) + (is (p/thrown? (str/starts-with? :a/b ":a")))] + :cljr [(is (p/thrown? (str/starts-with? 'ab ":a"))) (is (p/thrown? (str/starts-with? :ab ":a"))) (is (p/thrown? (str/starts-with? 'a/b ":a"))) diff --git a/test/clojure/string_test/upper_case.cljc b/test/clojure/string_test/upper_case.cljc index 738f43a3..6dc01723 100644 --- a/test/clojure/string_test/upper_case.cljc +++ b/test/clojure/string_test/upper_case.cljc @@ -13,7 +13,17 @@ (let [s "asdf"] (is (= "ASDF" (str/upper-case "asdf"))) (is (= "asdf" s) "original string mutated")) - #?(:cljr + ;; Phel's string functions are strict: a non-string argument throws + ;; rather than being coerced via `str`/`toString` (the JVM `:default` + ;; behaviour). Documented divergence; matches the :cljs/:lpy/:cljr stance. + #?(:phel + (are [v] (p/thrown? (str/upper-case v)) + :asdf + :asdf/asdf + 'asdf + 'asdf/asdf) + + :cljr (are [v] (p/thrown? (str/upper-case v)) :asdf :asdf/asdf