diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-09-04 04:51:49 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-09-04 04:51:49 +0900 |
| commit | 4051577d6b037e9d9dbeaa8817b906f7b3a8eb26 (patch) | |
| tree | 23b7c68ad3128cf980c4ede60cfe99ddf557cc51 /system | |
| parent | ddfb865e2d526485935099a8cd454929ed5f6176 (diff) | |
container/stub: override goexit methods
FailNow, Fatal, Fatalf, SkipNow, Skip and Skipf must be called from the goroutine created by the test.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system')
| -rw-r--r-- | system/dispatcher_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/system/dispatcher_test.go b/system/dispatcher_test.go index e5b703f6..7fbb75c2 100644 --- a/system/dispatcher_test.go +++ b/system/dispatcher_test.go @@ -43,8 +43,8 @@ func checkOpBehaviour(t *testing.T, testCases []opBehaviourTestCase) { ec = (*Criteria)(&tc.ec) } - defer stub.HandleExit() sys, s := InternalNew(t, stub.Expect{Calls: slices.Concat(tc.apply, []stub.Call{{Name: stub.CallSeparator}}, tc.revert)}, tc.uid) + defer s.HandleExit() errApply := tc.op.apply(sys) s.Expects(stub.CallSeparator) if !reflect.DeepEqual(errApply, tc.wantErrApply) { @@ -90,8 +90,8 @@ func checkOpsBuilder(t *testing.T, fname string, testCases []opsBuilderTestCase) t.Run(tc.name, func(t *testing.T) { t.Helper() - defer stub.HandleExit() sys, s := InternalNew(t, tc.exp, tc.uid) + defer s.HandleExit() tc.f(sys) s.VisitIncomplete(func(s *stub.Stub[syscallDispatcher]) { t.Helper() |
