MCPcopy
hub / github.com/basecamp/once / TestErrorMessage

Function TestErrorMessage

internal/docker/errors_test.go:18–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

16}
17
18func TestErrorMessage(t *testing.T) {
19 t.Run("returns description for described error", func(t *testing.T) {
20 assert.Equal(t, ErrProxyPortInUse.Description(), ErrorMessage(ErrProxyPortInUse))
21 })
22
23 t.Run("returns description for wrapped described error", func(t *testing.T) {
24 wrapped := fmt.Errorf("setup failed: %w", ErrProxyPortInUse)
25 assert.Equal(t, ErrProxyPortInUse.Description(), ErrorMessage(wrapped))
26 })
27
28 t.Run("returns Error for plain error", func(t *testing.T) {
29 err := errors.New("something broke")
30 assert.Equal(t, "something broke", ErrorMessage(err))
31 })
32}

Callers

nothing calls this directly

Calls 4

ErrorMessageFunction · 0.85
EqualMethod · 0.80
DescriptionMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…