-
Notifications
You must be signed in to change notification settings - Fork 13
parse functions #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parse functions #90
Conversation
false "false" | ||
true "true" | ||
nil "" | ||
nil "foo" | ||
nil "False" | ||
nil "FALSE" | ||
nil "True" | ||
nil "TRUE")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These parsing functions are quite involved, so I think we can have quite a bit more rigor here.
Would be good to have edge case tests for prefix/suffix (i.e. ttrue
and truee
). Also good to have tests for number strings (since 1
is commonly convertible to bool). Also, we should test for how whitespace is handled (on either end, and in the middle).
(are [expected x] (= expected (parse-uuid x)) | ||
nil "" | ||
nil "0" | ||
nil "df0993") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if it's a valid UUID + some extra?
nil "" | ||
nil "foo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clojure also supports scientific notation, like 1.5e10
, which also supports uppercase E
.
1.0 "1.000" | ||
5.6 "+5.6" | ||
-8.7 "-8.7" | ||
##Inf "Infinity" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the edge case of two numbers next two each other, like Infinity7
?
@jeaye please check again. Let me know if there's any more tests to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
No description provided.