Skip to content

Commit

Permalink
Merge pull request ipfs/interface-go-ipfs-core#76 from ipfs/fix/check…
Browse files Browse the repository at this point in the history
…-error-as-string

fix: check errors by string

This commit was moved from ipfs/interface-go-ipfs-core@275b80e
  • Loading branch information
Stebalien authored Aug 17, 2021
2 parents eecaeeb + e322a5b commit b62f39d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions coreapi/iface/tests/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package tests

import (
"context"
"errors"
"math"
"strings"
"testing"

"github.com/ipfs/go-path/resolver"
"github.com/ipfs/interface-go-ipfs-core/path"

"github.com/ipfs/interface-go-ipfs-core/options"
Expand Down Expand Up @@ -141,7 +139,7 @@ func (tp *TestSuite) TestInvalidPathRemainder(t *testing.T) {
}

_, err = api.ResolvePath(ctx, path.New("/ipld/"+nd.Cid().String()+"/bar/baz"))
if err == nil || !errors.As(err, &resolver.ErrNoLink{}) {
if err == nil || !strings.Contains(err.Error(), `no link named "bar"`) {
t.Fatalf("unexpected error: %s", err)
}
}
Expand Down

0 comments on commit b62f39d

Please sign in to comment.