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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for geojson integer ids #667

Merged
merged 1 commit into from
Dec 14, 2022
Merged

Conversation

lognaturel
Copy link
Member

@lognaturel lognaturel commented Apr 7, 2022

Closes #666 馃槇

A few additional test cases to verify that integer ids are supported. I also verified in Collect and didn't see any problems.

assertThat(featureCollection.getChildAt(0).getNumChildren(), is(4));
assertThat(featureCollection.getChildAt(0).getChild("id", 0).getValue().getValue(), is("77"));

assertThat(featureCollection.getChildAt(1).getChild("id", 0).getValue().getValue(), is("78"));
Copy link
Member

Choose a reason for hiding this comment

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

Unless I'm missing something, there is no reason to have more than one feature in the JSON to check that integer IDs get parsed correctly.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is not my best habit. While I like targeted tests, I'm also very paranoid about the 1-element case being special. You're right that it's really not necessary here and I've removed it.

@lognaturel lognaturel merged commit 412ee8d into getodk:master Dec 14, 2022
@lognaturel lognaturel deleted the integer-ids branch December 14, 2022 21:27
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.

Support integer id from geojson files
2 participants