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

Fix java encoding to accept codeLength of 2 and add test cases #362

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JonMcPherson
Copy link
Contributor

@JonMcPherson JonMcPherson commented Sep 3, 2019

The encoding of codes with length 2 should be allowed as specified, but the Java implementation unnecessarily limits the codeLength to a minimum length of 4 by mistake.

This bug was originally discovered by @brewmanz in the C# implementation, which inherited this bug from the Java implementation since day 1.
See discussion in issue #360 (comment)

@JonMcPherson
Copy link
Contributor Author

It appears that the encoding tests in most implementations do not account for expected encoding failures like the test_data/encoding.csv specifies:

expected code (empty if the input should cause an error)

https://github.com/google/open-location-code/blob/master/test_data/encoding.csv#L6
So we will need to update the tests to support expected encoding failures.

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

Successfully merging this pull request may close these issues.

None yet

3 participants