(t *testing.T)
| 20 | } |
| 21 | |
| 22 | func TestIsNotFound(t *testing.T) { |
| 23 | tests := []struct { |
| 24 | name string |
| 25 | err error |
| 26 | expVal bool |
| 27 | }{ |
| 28 | { |
| 29 | name: "error does not implement NotFound", |
| 30 | err: errors.New("a simple error"), |
| 31 | expVal: false, |
| 32 | }, |
| 33 | { |
| 34 | name: "error implements NotFound but not a not found", |
| 35 | err: notFoundError{val: false}, |
| 36 | expVal: false, |
| 37 | }, |
| 38 | { |
| 39 | name: "error implements NotFound", |
| 40 | err: notFoundError{val: true}, |
| 41 | expVal: true, |
| 42 | }, |
| 43 | } |
| 44 | for _, test := range tests { |
| 45 | t.Run(test.name, func(t *testing.T) { |
| 46 | assert.Equal(t, test.expVal, IsNotFound(test.err)) |
| 47 | }) |
| 48 | } |
| 49 | } |
nothing calls this directly
no test coverage detected