1 // Copyright 2019 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 "golang.org/x/xerrors"
16 func TestErrorsIs(t *testing.T) {
17 var errSentinel = errors.New("sentinel")
19 got := errors.Is(xerrors.Errorf("%w", errSentinel), errSentinel)
21 t.Error("got false, want true")
24 got = errors.Is(xerrors.Errorf("%w: %s", errSentinel, "foo"), errSentinel)
26 t.Error("got false, want true")