Even more tests/benchmarks, less repetition in-code#34
Merged
Conversation
ribasushi
commented
May 23, 2020
Comment on lines
+92
to
+100
| _, _, 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") | ||
| } |
Contributor
Author
There was a problem hiding this comment.
@Stebalien currently identity-base ( skipped above ) does not fail on "\u..." strings. Not sure if it should or not...
Contributor
Author
There was a problem hiding this comment.
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.
Stebalien
approved these changes
May 23, 2020
Member
Stebalien
left a comment
There was a problem hiding this comment.
I think we intentionally duplicated the map to detect typos and accidental changes, but actual tests (which we have now) are better anyways.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No functional changes in this one, serves as a basis for additional PRs