Skip to content

Fix repeated-field multiplicity in struct equivalence - #456

Open
Shubham-Padkonde wants to merge 1 commit into
amazon-ion:masterfrom
Shubham-Padkonde:fix/struct-equivalence-multiplicity
Open

Shubham-Padkonde wants to merge 1 commit into
amazon-ion:masterfrom
Shubham-Padkonde:fix/struct-equivalence-multiplicity

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

Issue #, if available: Not previously reported.

Description of changes:

ion_equals currently considers {field: 1, field: 1, field: 2} equivalent to {field: 1, field: 2, field: 2}. The repeated-field comparison only checks whether each value has any match, allowing the same occurrence to satisfy multiple matches in both directions.

Consume each matched occurrence from a temporary list so repeated-field counts matter while field order remains irrelevant. This retains Ion's recursive comparison semantics for unhashable values, NaNs, and signed zero, and does not mutate either input.

Validation: four new regression cases fail before the fix; all seven new cases pass afterward. The Python test suite excluding vector and benchmark tests passes: 21,529 passed, 5 skipped. Vector fixtures and the native C extension were not exercised in this run.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

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.

1 participant