-
Notifications
You must be signed in to change notification settings - Fork 17
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
Even more tests/benchmarks, less repetition in-code #34
Conversation
_, _, err := Decode(string(base) + "\u00A0") | ||
if err == nil { | ||
t.Fatal(EncodingToStr[base] + " decode should fail on low-unicode") | ||
} | ||
|
||
_, _, err = Decode(string(base) + "\u1F4A8") | ||
if err == nil { | ||
t.Fatal(EncodingToStr[base] + " decode should fail on emoji") | ||
} |
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.
@Stebalien currently identity-base ( skipped above ) does not fail on "\u..." strings. Not sure if it should or not...
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.
Why would it?
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.
Because runes vs "bare bytes". Like... generally "low level" interfaces like this should not accept unicode in "decoded" form. But maybe in go it is idiomatic to just assume utf8 everywhere, and trip both ways correctly.
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.
🤷
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.
I think we intentionally duplicated the map to detect typos and accidental changes, but actual tests (which we have now) are better anyways.
No functional changes in this one, serves as a basis for additional PRs