diff options
Diffstat (limited to 'src/errors/wrap_test.go')
| -rw-r--r-- | src/errors/wrap_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/errors/wrap_test.go b/src/errors/wrap_test.go index 022f429c0c..f8e907cff7 100644 --- a/src/errors/wrap_test.go +++ b/src/errors/wrap_test.go @@ -47,6 +47,12 @@ func TestIs(t *testing.T) { {poser, errb, false}, {poser, erro, false}, {poser, errco, false}, + {errorUncomparable{}, errorUncomparable{}, true}, + {errorUncomparable{}, &errorUncomparable{}, false}, + {&errorUncomparable{}, errorUncomparable{}, true}, + {&errorUncomparable{}, &errorUncomparable{}, false}, + {errorUncomparable{}, err1, false}, + {&errorUncomparable{}, err1, false}, } for _, tc := range testCases { t.Run("", func(t *testing.T) { @@ -260,3 +266,16 @@ type printer struct { } func (p *printer) Print(args ...interface{}) { fmt.Fprint(&p.buf, args...) } + +type errorUncomparable struct { + f []string +} + +func (errorUncomparable) Error() string { + return "uncomparable error" +} + +func (errorUncomparable) Is(target error) bool { + _, ok := target.(errorUncomparable) + return ok +} |
