container/dispatcher: check test errors via reflect
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 1m51s
Test / Hpkg (push) Successful in 3m40s
Test / Sandbox (race detector) (push) Successful in 4m17s
Test / Hakurei (race detector) (push) Successful in 5m23s
Test / Hakurei (push) Successful in 2m21s
Test / Flake checks (push) Successful in 1m33s
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 1m51s
Test / Hpkg (push) Successful in 3m40s
Test / Sandbox (race detector) (push) Successful in 4m17s
Test / Hakurei (race detector) (push) Successful in 5m23s
Test / Hakurei (push) Successful in 2m21s
Test / Flake checks (push) Successful in 1m33s
Using the errors package might conceal some incorrect behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
8d472ebf2b
commit
1c7e634f09
@ -146,14 +146,14 @@ func checkOpBehaviour(t *testing.T, testCases []opBehaviourTestCase) {
|
|||||||
k := &kstub{t: t, want: [][]kexpect{slices.Concat(tc.early, []kexpect{{name: "\x00"}}, tc.apply)}, wg: new(sync.WaitGroup)}
|
k := &kstub{t: t, want: [][]kexpect{slices.Concat(tc.early, []kexpect{{name: "\x00"}}, tc.apply)}, wg: new(sync.WaitGroup)}
|
||||||
errEarly := tc.op.early(state, k)
|
errEarly := tc.op.early(state, k)
|
||||||
k.expect("\x00")
|
k.expect("\x00")
|
||||||
if !errors.Is(errEarly, tc.wantErrEarly) {
|
if !reflect.DeepEqual(errEarly, tc.wantErrEarly) {
|
||||||
t.Errorf("early: error = %v, want %v", errEarly, tc.wantErrEarly)
|
t.Errorf("early: error = %v, want %v", errEarly, tc.wantErrEarly)
|
||||||
}
|
}
|
||||||
if errEarly != nil {
|
if errEarly != nil {
|
||||||
goto out
|
goto out
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := tc.op.apply(state, k); !errors.Is(err, tc.wantErrApply) {
|
if err := tc.op.apply(state, k); !reflect.DeepEqual(err, tc.wantErrApply) {
|
||||||
t.Errorf("apply: error = %v, want %v", err, tc.wantErrApply)
|
t.Errorf("apply: error = %v, want %v", err, tc.wantErrApply)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user