MCPcopy Create free account
hub / github.com/gogs/gogs / TestError_NotFound

Function TestError_NotFound

internal/gitutil/error_test.go:13–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestError_NotFound(t *testing.T) {
14 tests := []struct {
15 err error
16 expVal bool
17 }{
18 {err: git.ErrSubmoduleNotExist, expVal: true},
19 {err: git.ErrRevisionNotExist, expVal: true},
20 {err: git.ErrNoMergeBase, expVal: false},
21 }
22 for _, test := range tests {
23 t.Run("", func(t *testing.T) {
24 assert.Equal(t, test.expVal, errutil.IsNotFound(NewError(test.err)))
25 })
26 }
27}
28
29func TestIsErrRevisionNotExist(t *testing.T) {
30 assert.True(t, IsErrRevisionNotExist(git.ErrRevisionNotExist))

Callers

nothing calls this directly

Calls 2

IsNotFoundFunction · 0.92
NewErrorFunction · 0.70

Tested by

no test coverage detected