Skip to content

Even more tests/benchmarks, less repetition in-code#34

Merged
Stebalien merged 1 commit intomasterfrom
feat/yet-more-tests
May 23, 2020
Merged

Even more tests/benchmarks, less repetition in-code#34
Stebalien merged 1 commit intomasterfrom
feat/yet-more-tests

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