diff --git a/test/clojure/core_test/parse_boolean.cljc b/test/clojure/core_test/parse_boolean.cljc index 04e37174..92299206 100644 --- a/test/clojure/core_test/parse_boolean.cljc +++ b/test/clojure/core_test/parse_boolean.cljc @@ -25,7 +25,20 @@ nil "true ")) (testing "exceptions" - #?(:lpy (are [x] (p/thrown? (parse-boolean x)) + ;; Phel's `parse-boolean` is intentionally nil-safe: it returns `nil` for + ;; any non-string input (and any string other than "true"/"false") + ;; instead of throwing, so it can be chained in `when`/`if-let` without + ;; guarding. Documented divergence. + #?(:phel (are [x] (nil? (parse-boolean x)) + nil + 0 + 0.0 + :key + {} + '() + #{} + []) + :lpy (are [x] (p/thrown? (parse-boolean x)) nil 0 0.0 diff --git a/test/clojure/core_test/parse_double.cljc b/test/clojure/core_test/parse_double.cljc index 9d099eba..e88737cf 100644 --- a/test/clojure/core_test/parse_double.cljc +++ b/test/clojure/core_test/parse_double.cljc @@ -35,7 +35,18 @@ ##Inf "Infinity" ##-Inf "-Infinity")) (testing "exceptions" - #?(:lpy (are [x] (p/thrown? (parse-double x)) + ;; Phel's `parse-double` is intentionally nil-safe: it returns `nil` for + ;; any non-string (or unparseable) input instead of throwing, so it can + ;; be chained in `when`/`if-let` without guarding. Documented divergence. + #?(:phel (are [x] (nil? (parse-double x)) + {} + '() + [] + #{} + :key + 0.0 + 1000) + :lpy (are [x] (p/thrown? (parse-double x)) {} '() [] diff --git a/test/clojure/core_test/parse_long.cljc b/test/clojure/core_test/parse_long.cljc index e450cb95..5d86181e 100644 --- a/test/clojure/core_test/parse_long.cljc +++ b/test/clojure/core_test/parse_long.cljc @@ -33,7 +33,18 @@ 999999999999999 "999999999999999"] :default [999999999999999999 "999999999999999999"]))) (testing "exceptions" - #?(:lpy (are [x] (p/thrown? (parse-long x)) + ;; Phel's `parse-long` is intentionally nil-safe: it returns `nil` for + ;; any non-string (or unparseable) input instead of throwing, so it can + ;; be chained in `when`/`if-let` without guarding. Documented divergence. + #?(:phel (are [x] (nil? (parse-long x)) + {} + '() + [] + #{} + :key + 0.0 + 1000) + :lpy (are [x] (p/thrown? (parse-long x)) {} '() [] diff --git a/test/clojure/core_test/parse_uuid.cljc b/test/clojure/core_test/parse_uuid.cljc index 4d3260a1..be52dae2 100644 --- a/test/clojure/core_test/parse_uuid.cljc +++ b/test/clojure/core_test/parse_uuid.cljc @@ -24,7 +24,19 @@ #uuid "00000012-0034-0056-0078-000000000009" "12-34-56-78-9" #uuid "00000005-0004-0003-0002-009000000001" "5-4-3-DEADBEEF0002-9000000001")) (testing "exceptions" - #?(:lpy (are [x] (p/thrown? (parse-uuid x)) + ;; Phel's `parse-uuid` is intentionally nil-safe: it returns `nil` for + ;; any non-string, non-UUID input instead of throwing, so it can be + ;; chained in `when`/`if-let` without guarding. Documented divergence. + #?(:phel (are [x] (nil? (parse-uuid x)) + {} + '() + [] + #{} + :key + 0.0 + 1000) + + :lpy (are [x] (p/thrown? (parse-uuid x)) {} '() []