Skip to content

Commit

Permalink
xerrors: remove go1.13 build constraint for TestErrorsIs
Browse files Browse the repository at this point in the history
All supported Go releases have the go1.13 build constraint satisfied.

Change-Id: Ie298f73edbb79939511091c528ec138ec00613c1
Reviewed-on: https://go-review.googlesource.com/c/xerrors/+/610075
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
dmitshur authored and gopherbot committed Sep 3, 2024
1 parent 9acd5f3 commit cf14814
Showing 2 changed files with 15 additions and 28 deletions.
28 changes: 0 additions & 28 deletions wrap_113_test.go

This file was deleted.

15 changes: 15 additions & 0 deletions wrap_test.go
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
package xerrors_test

import (
"errors"
"fmt"
"os"
"testing"
@@ -84,6 +85,20 @@ func (p *poser) As(err interface{}) bool {
return true
}

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")
}
}

func TestAs(t *testing.T) {
var errT errorT
var errP *os.PathError

0 comments on commit cf14814

Please sign in to comment.