Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

rafonsecad
Copy link
Contributor

No description provided.

Comment on lines +10 to +17
false "false"
true "true"
nil ""
nil "foo"
nil "False"
nil "FALSE"
nil "True"
nil "TRUE"))
Copy link
Member

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).

Comment on lines +9 to +12
(are [expected x] (= expected (parse-uuid x))
nil ""
nil "0"
nil "df0993")
Copy link
Member

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?

Comment on lines +10 to +11
nil ""
nil "foo"
Copy link
Member

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"
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants