coreapi: few more error check fixes
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
Łukasz Magiera committed
Jan 21, 2019 at 21:31 UTC
480a3a3de1e481d04ddf410cab804d2e5e05f305
3 files changed
+3
-3
core/coreapi/interface/tests/dag.go
+1
-1
@@ -185,7 +185,7 @@ func (tp *provider) TestBatch(t *testing.T) {
185
}
186
187
_, 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") {
189
t.Error(err)
190
}
191
core/coreapi/interface/tests/path.go
+1
-1
@@ -151,7 +151,7 @@ func (tp *provider) TestInvalidPathRemainder(t *testing.T) {
151
}
152
153
_, 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") {
155
t.Fatalf("unexpected error: %s", err)
156
}
157
}
core/coreapi/interface/tests/unixfs.go
+1
-1
@@ -587,7 +587,7 @@ func (tp *provider) TestAddHashOnly(t *testing.T) {
587
if err == nil {
588
t.Fatal("expected an error")
589
}
590
- if err.Error() != "blockservice: key not found" {
590
+ if !strings.Contains(err.Error(), "blockservice: key not found") {
591
t.Errorf("unxepected error: %s", err.Error())
592
}
593
}