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"
12062
12062
(throw (js/Error. (parsing-err s)))))
12063
12063
12064
12064
(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 ]$" )
12066
12066
12067
12067
(defn parse-uuid
12068
12068
" Parse a string representing a UUID and return a UUID instance,
Original file line number Diff line number Diff line change 80
80
(are [s] ; ; throw on invalid type (not string)
81
81
(try (parse-uuid s) (is false ) (catch :default _ (is true )))
82
82
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" ))))
84
92
85
93
(deftest test-parse-boolean
86
94
(is (identical? true (parse-boolean " true" )))
You can’t perform that action at this time.
0 commit comments