Skip to content

Commit a0edead

Browse files
authored
Merge pull request #148 from apelisse/run-union-after
Run non-required union tests last
2 parents 446b504 + e289fc9 commit a0edead

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

internal/fixture/state.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,6 @@ func (tc TestCase) TestWithConverter(parser typed.ParseableType, converter merge
425425
}
426426
if tc.RequiresUnions {
427427
state.Updater.EnableUnionFeature()
428-
} else {
429-
// Also test it with unions on.
430-
tc2 := tc
431-
tc2.RequiresUnions = true
432-
err := tc2.TestWithConverter(parser, converter)
433-
if err != nil {
434-
return fmt.Errorf("fails if unions are on: %v", err)
435-
}
436428
}
437429
// We currently don't have any test that converts, we can take
438430
// care of that later.
@@ -467,5 +459,15 @@ func (tc TestCase) TestWithConverter(parser typed.ParseableType, converter merge
467459
}
468460
}
469461

462+
if !tc.RequiresUnions {
463+
// Re-run the test with unions on.
464+
tc2 := tc
465+
tc2.RequiresUnions = true
466+
err := tc2.TestWithConverter(parser, converter)
467+
if err != nil {
468+
return fmt.Errorf("fails if unions are on: %v", err)
469+
}
470+
}
471+
470472
return nil
471473
}

0 commit comments

Comments
 (0)