aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/stub/exit.go
diff options
context:
space:
mode:
Diffstat (limited to 'container/stub/exit.go')
-rw-r--r--container/stub/exit.go44
1 files changed, 0 insertions, 44 deletions
diff --git a/container/stub/exit.go b/container/stub/exit.go
deleted file mode 100644
index 062ee2e0..00000000
--- a/container/stub/exit.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package stub
-
-import "testing"
-
-// PanicExit is a magic panic value treated as a simulated exit.
-const PanicExit = 0xdead
-
-const (
- panicFailNow = 0xcafe0 + iota
- panicFatal
- panicFatalf
-)
-
-// HandleExit must be deferred before calling with the stub.
-func HandleExit(t testing.TB) {
- switch r := recover(); r {
- case PanicExit:
- break
-
- case panicFailNow:
- t.FailNow()
-
- case panicFatal, panicFatalf, nil:
- break
-
- default:
- panic(r)
- }
-}
-
-// handleExitNew handles exits from goroutines created by [Stub.New].
-func handleExitNew(t testing.TB) {
- switch r := recover(); r {
- case PanicExit, panicFatal, panicFatalf, nil:
- break
-
- case panicFailNow:
- t.Fail()
- break
-
- default:
- panic(r)
- }
-}