MCPcopy
hub / github.com/github/gh-ost / TestSetAbortError_StoresFirstError

Function TestSetAbortError_StoresFirstError

go/base/context_test.go:219–232  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

217}
218
219func TestSetAbortError_StoresFirstError(t *testing.T) {
220 ctx := NewMigrationContext()
221
222 err1 := errors.New("first error")
223 err2 := errors.New("second error")
224
225 ctx.SetAbortError(err1)
226 ctx.SetAbortError(err2)
227
228 got := ctx.GetAbortError()
229 if got != err1 { //nolint:errorlint // Testing pointer equality for sentinel error
230 t.Errorf("Expected first error %v, got %v", err1, got)
231 }
232}
233
234func TestSetAbortError_ThreadSafe(t *testing.T) {
235 ctx := NewMigrationContext()

Callers

nothing calls this directly

Calls 4

SetAbortErrorMethod · 0.95
GetAbortErrorMethod · 0.95
NewMigrationContextFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…