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

Add extra validation steps and unit tests #675

Merged
merged 3 commits into from
Sep 20, 2024

Conversation

Cawllec
Copy link
Contributor

@Cawllec Cawllec commented Sep 19, 2024

Goal

Adds some extra functions to shortcut a bunch of more complicated logic that had to be used in the Go tests.

Comment on lines 48 to 50
elsif element.kind_of?(Array) && element.empty?
@success = false
@errors << "Element '#{path}' was an empty array"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this makes sense - we always consider empty arrays as "missing"? I can imagine that quirks in various platforms could cause an empty array to be serialised from "nothing".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed this, and have set it to allow arrays to be marked as present. Otherwise I can see this potentially being a tripping point as it's not obvious what's happening.

Copy link
Contributor

@twometresteve twometresteve left a comment

Choose a reason for hiding this comment

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

LGTM, seems clean and well thought out.

@Cawllec Cawllec force-pushed the validation/extra-capabilities branch from 7298951 to 4b35357 Compare September 20, 2024 08:43
@Cawllec Cawllec merged commit f947f9a into main Sep 20, 2024
25 checks passed
@Cawllec Cawllec deleted the validation/extra-capabilities branch September 20, 2024 09:45
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