Commit eb51a9d
refactor(invariant): rename to InvariantSecondaryFailure / invariant_secondary_failures and serialize sparsely
Renames TestResult.other_failures -> invariant_secondary_failures and
the underlying InvariantOtherFailure struct -> InvariantSecondaryFailure.
The previous names were generic ('other relative to what?'); the new
names align with the existing 'primary/secondary' terminology used
throughout the assert_all rollout and follow the Rust Vec<Foo>/foos
plural-of-singular convention.
Also marks the field with #[serde(default, skip_serializing_if =
'Vec::is_empty')] so it is omitted from JSON output for any test that
has no secondary failure data — plain unit tests, fuzz tests, passing
tests. Pre-PR JSON consumers continue to see the same shape on those
results. invariant_failure_dir and assert_all_invariant_count already
had Option::is_none guards.
Updates the SimpleContractTest{NonVerbose,Verbose}.json fixtures to
drop the now-skipped empty field.
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dce2d-57c7-734a-bbc6-6fa5e34b25de1 parent c09d7c1 commit eb51a9d
4 files changed
Lines changed: 15 additions & 15 deletions
File tree
- crates/forge
- src
- tests/fixtures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
| 416 | + | |
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
| 446 | + | |
| 447 | + | |
447 | 448 | | |
448 | 449 | | |
449 | 450 | | |
| |||
541 | 542 | | |
542 | 543 | | |
543 | 544 | | |
544 | | - | |
| 545 | + | |
545 | 546 | | |
546 | 547 | | |
547 | 548 | | |
| |||
576 | 577 | | |
577 | 578 | | |
578 | 579 | | |
579 | | - | |
| 580 | + | |
| 581 | + | |
580 | 582 | | |
581 | 583 | | |
582 | 584 | | |
583 | 585 | | |
584 | | - | |
| 586 | + | |
585 | 587 | | |
586 | 588 | | |
587 | 589 | | |
588 | | - | |
| 590 | + | |
589 | 591 | | |
590 | 592 | | |
591 | 593 | | |
| |||
612 | 614 | | |
613 | 615 | | |
614 | 616 | | |
615 | | - | |
| 617 | + | |
616 | 618 | | |
617 | 619 | | |
618 | 620 | | |
| |||
821 | 823 | | |
822 | 824 | | |
823 | 825 | | |
824 | | - | |
| 826 | + | |
825 | 827 | | |
826 | 828 | | |
827 | 829 | | |
| |||
846 | 848 | | |
847 | 849 | | |
848 | 850 | | |
849 | | - | |
| 851 | + | |
850 | 852 | | |
851 | 853 | | |
852 | 854 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
988 | 988 | | |
989 | 989 | | |
990 | 990 | | |
991 | | - | |
| 991 | + | |
992 | 992 | | |
993 | 993 | | |
994 | 994 | | |
| |||
1192 | 1192 | | |
1193 | 1193 | | |
1194 | 1194 | | |
1195 | | - | |
| 1195 | + | |
1196 | 1196 | | |
1197 | 1197 | | |
1198 | 1198 | | |
| |||
1213 | 1213 | | |
1214 | 1214 | | |
1215 | 1215 | | |
1216 | | - | |
| 1216 | + | |
1217 | 1217 | | |
1218 | 1218 | | |
1219 | 1219 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
0 commit comments