File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -12062,7 +12062,7 @@ reduces them without incurring seq initialization"
1206212062 (throw (js/Error. (parsing-err s)))))
1206312063
1206412064(def ^:private uuid-regex
12065- #"^[0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ]-[0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ]-[0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ]-[0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ]-[0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ][0-9a-zA-Z ]$" )
12065+ #"^[0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ]-[0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ]-[0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ]-[0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ]-[0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ][0-9a-fA-F ]$" )
1206612066
1206712067(defn parse-uuid
1206812068 " Parse a string representing a UUID and return a UUID instance,
Original file line number Diff line number Diff line change 8080 (are [s] ; ; throw on invalid type (not string)
8181 (try (parse-uuid s) (is false ) (catch :default _ (is true )))
8282 123
83- nil ))
83+ nil )
84+ ; ; parse the nil uuid
85+ (is (parse-uuid " 00000000-0000-0000-0000-000000000000" ))
86+ ; ; parse a version 1 UUID
87+ (is (parse-uuid " 123e4567-e89b-12d3-a456-426614174000" ))
88+ ; ; parse a version 2 UUID
89+ (is (parse-uuid " 123e4567-e89b-22d3-a456-426614174000" ))
90+ ; ; ensure that bad characters are invalid
91+ (is (nil? (parse-uuid " 123e4567-eg9b-12d3-a456-426614174000" ))))
8492
8593(deftest test-parse-boolean
8694 (is (identical? true (parse-boolean " true" )))
You can’t perform that action at this time.
0 commit comments