summaryrefslogtreecommitdiffstats
path: root/dependencies/pkg/mod/golang.org/x/xerrors@v0.0.0-20220907171357-04be3eba64a2/wrap_113_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'dependencies/pkg/mod/golang.org/x/xerrors@v0.0.0-20220907171357-04be3eba64a2/wrap_113_test.go')
-rw-r--r--dependencies/pkg/mod/golang.org/x/xerrors@v0.0.0-20220907171357-04be3eba64a2/wrap_113_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/dependencies/pkg/mod/golang.org/x/xerrors@v0.0.0-20220907171357-04be3eba64a2/wrap_113_test.go b/dependencies/pkg/mod/golang.org/x/xerrors@v0.0.0-20220907171357-04be3eba64a2/wrap_113_test.go
new file mode 100644
index 0000000..48fedb5
--- /dev/null
+++ b/dependencies/pkg/mod/golang.org/x/xerrors@v0.0.0-20220907171357-04be3eba64a2/wrap_113_test.go
@@ -0,0 +1,29 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build go1.13
+// +build go1.13
+
+package xerrors_test
+
+import (
+ "errors"
+ "testing"
+
+ "golang.org/x/xerrors"
+)
+
+func TestErrorsIs(t *testing.T) {
+ var errSentinel = errors.New("sentinel")
+
+ got := errors.Is(xerrors.Errorf("%w", errSentinel), errSentinel)
+ if !got {
+ t.Error("got false, want true")
+ }
+
+ got = errors.Is(xerrors.Errorf("%w: %s", errSentinel, "foo"), errSentinel)
+ if !got {
+ t.Error("got false, want true")
+ }
+}