Skip to content

Commit 3f88fb4

Browse files
committed
Test parse-uuid tolerance to non-standard forms
1 parent 9b38590 commit 3f88fb4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/clojure/core_test/parse_uuid.cljc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
(when-var-exists clojure.core/instance?
1717
#?(:clj (is (instance? java.util.UUID (parse-uuid "b6883c0a-0342-4007-9966-bc2dfa6b109e"))))
1818
#?(:cljs (is (instance? cljs.core.UUID (parse-uuid "b6883c0a-0342-4007-9966-bc2dfa6b109e"))))))
19+
(testing "tolerance to non-standard forms"
20+
(are [expected s] (= #?(:cljr nil :default expected) (parse-uuid s)) ; cljr is strict
21+
#uuid "00000000-0000-0000-0000-000000000000" "0-0-0-0-0"
22+
#uuid "00000012-0034-0056-0078-000000000009" "12-34-56-78-9"
23+
#uuid "00000005-0004-0003-0002-009000000001" "5-4-3-DEADBEEF0002-9000000001"))
1924
(testing "exceptions"
2025
#?(:clj (are [x] (thrown? Exception (parse-uuid x))
2126
{}

0 commit comments

Comments
 (0)