Context
Parent: #160
Five report types (TraceReport, ChainReport, CutReport, DiffReport, PackagesReport) each need the same set of tests: JSON field validation, terminal output format, empty-data handling, large-data handling. Writing these by hand is repetitive and error-prone — exactly the case RFR recommends macro-generated test batteries.
Expected Behavior
A test_battery! macro that generates a standard set of tests for each report type, reducing per-type boilerplate to one line.
Scope
test_battery! macro that takes a report type and a constructor closure
- Generated tests per type:
to_json() produces valid JSON
to_json() field names match expected set
to_terminal() produces non-empty output
to_terminal() with color: false produces no ANSI codes
- Empty data (zero modules/packages) doesn't panic
- Round-trip:
to_json() contains all data from the struct
- Add one invocation per report type
Context
Parent: #160
Five report types (
TraceReport,ChainReport,CutReport,DiffReport,PackagesReport) each need the same set of tests: JSON field validation, terminal output format, empty-data handling, large-data handling. Writing these by hand is repetitive and error-prone — exactly the case RFR recommends macro-generated test batteries.Expected Behavior
A
test_battery!macro that generates a standard set of tests for each report type, reducing per-type boilerplate to one line.Scope
test_battery!macro that takes a report type and a constructor closureto_json()produces valid JSONto_json()field names match expected setto_terminal()produces non-empty outputto_terminal()withcolor: falseproduces no ANSI codesto_json()contains all data from the struct