Skip to content
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

Merged
merged 1 commit into from
May 23, 2020

Conversation

ribasushi
Copy link
Contributor

No functional changes in this one, serves as a basis for additional PRs

@ribasushi ribasushi requested a review from Stebalien May 23, 2020 00:52
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")
}
Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would it?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷

Copy link
Member

@Stebalien Stebalien left a 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.

@Stebalien Stebalien merged commit ee5c233 into master May 23, 2020
@ribasushi ribasushi deleted the feat/yet-more-tests branch May 24, 2020 18:54
@Stebalien Stebalien mentioned this pull request May 26, 2020
77 tasks
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