Skip to content

Commit 532c9bd

Browse files
authored
Merge pull request #5935 from ipfs/tests/coreapi-fixes
coreapi: few more error check fixes
2 parents 083d85c + 480a3a3 commit 532c9bd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

core/coreapi/interface/tests/dag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (tp *provider) TestBatch(t *testing.T) {
185185
}
186186

187187
_, err = api.Dag().Get(ctx, nds[0].Cid())
188-
if err == nil || err.Error() != "merkledag: not found" {
188+
if err == nil || !strings.Contains(err.Error(), "not found") {
189189
t.Error(err)
190190
}
191191

core/coreapi/interface/tests/path.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (tp *provider) TestInvalidPathRemainder(t *testing.T) {
151151
}
152152

153153
_, err = api.ResolvePath(ctx, p1)
154-
if err == nil || err.Error() != "no such link found" {
154+
if err == nil || !strings.Contains(err.Error(), "no such link found") {
155155
t.Fatalf("unexpected error: %s", err)
156156
}
157157
}

core/coreapi/interface/tests/unixfs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ func (tp *provider) TestAddHashOnly(t *testing.T) {
587587
if err == nil {
588588
t.Fatal("expected an error")
589589
}
590-
if err.Error() != "blockservice: key not found" {
590+
if !strings.Contains(err.Error(), "blockservice: key not found") {
591591
t.Errorf("unxepected error: %s", err.Error())
592592
}
593593
}

0 commit comments

Comments
 (0)