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 72af89d + f272493 commit 7bde2b6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions coreiface/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 7bde2b6

Please sign in to comment.