Skip to content

cs-test: array-shaped expected.fields and rendered.fields - #6

Merged
llbartekll merged 2 commits into
llbartekll:mainfrom
manuelwedler:array-shape-expected-fields
Jun 2, 2026
Merged

llbartekll merged 2 commits into
llbartekll:mainfrom
manuelwedler:array-shape-expected-fields

Conversation

@manuelwedler

Copy link
Copy Markdown
Contributor

Summary

The ERC-7730 registry's v2 test schema is reshaping expected.fields from a label-keyed map to an ordered array of {label, value} entries (spec PR on branch common-test-strategy). Array-iteration descriptor paths like signers.[] (e.g. Safe setup) render multiple entries with the same label — a map collapses them; an ordered array preserves them.

This PR updates cs-test to read and emit the new shape:

  • schemaExpected.fields and NestedExpected.fields become Vec<FieldEntry>. New FieldEntry { label, value } / FieldValue replace the label-keyed IndexMap<String, FieldExpected>.
  • compare — positional comparator. New FieldCountMismatch / FieldLabelMismatch variants; FieldValueMismatch / FieldKindMismatch carry an index. The old label-set logic (FieldMissing, FieldExtra, AmbiguousLabel) is gone — duplicates at different positions now compare cleanly instead of being flagged as ambiguous.
  • results.rscases[].rendered.fields emits the same array shape. Duplicate labels are preserved end-to-end instead of being silently collapsed by IndexMap::insert.
  • report, fixtures, smoke.rs — track the new variants and shape.
  • Drops unused indexmap dep.

Test plan

  • cargo test -p cs-test (22 unit + 4 smoke, including new positional cases: duplicate-labels-pass, swapped-positions-fail, length-mismatch, label-mismatch)
  • cargo clippy -p cs-test --all-targets -- -D warnings
  • End-to-end against the registry's only converted fixture, aave/testsv2/calldata-lpv2.tests.json on branch common-test-strategy: all 3 cases pass; results.json emits cases[].rendered.fields as ordered [{label, value}, ...].

Out of scope

  • Other ~250 testsv2 files in the registry — those land registry-side.
  • Descriptor format changes — unaffected.

🤖 Generated with Claude Code

manuelwedler and others added 2 commits June 2, 2026 07:18
The v2 test schema reshapes `expected.fields` from a label-keyed map to
an ordered array of {label, value} entries so array-iteration paths
(e.g. `signers.[]`) can render duplicate-label entries side by side
instead of silently collapsing to the last value.

- schema: Expected.fields and NestedExpected.fields become Vec<FieldEntry>;
  new FieldEntry/FieldValue replace label-keyed FieldExpected.
- compare: positional comparator. New FieldCountMismatch /
  FieldLabelMismatch variants; FieldValueMismatch / FieldKindMismatch
  now carry an index. Drops FieldMissing / FieldExtra / AmbiguousLabel.
- results.rs: cases[].rendered.fields emits the same array shape so
  the registry CI aggregator and the comparator speak one form.
- report, smoke fixtures, smoke.rs: track the new variants and shape.
- Drop unused indexmap dep.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@llbartekll
llbartekll merged commit 22196d3 into llbartekll:main Jun 2, 2026
3 checks passed
@manuelwedler
manuelwedler deleted the array-shape-expected-fields branch June 2, 2026 11:49
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