From 3f6567984606a34ed4cb2cdec37816614cf84b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 21 Jan 2019 21:31:52 +0100 Subject: [PATCH] coreapi: few more error check fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Ɓukasz Magiera --- core/coreapi/interface/tests/dag.go | 2 +- core/coreapi/interface/tests/path.go | 2 +- core/coreapi/interface/tests/unixfs.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/coreapi/interface/tests/dag.go b/core/coreapi/interface/tests/dag.go index e66106c3327e..10fab125a22e 100644 --- a/core/coreapi/interface/tests/dag.go +++ b/core/coreapi/interface/tests/dag.go @@ -185,7 +185,7 @@ func (tp *provider) TestBatch(t *testing.T) { } _, err = api.Dag().Get(ctx, nds[0].Cid()) - if err == nil || err.Error() != "merkledag: not found" { + if err == nil || !strings.Contains(err.Error(), "not found") { t.Error(err) } diff --git a/core/coreapi/interface/tests/path.go b/core/coreapi/interface/tests/path.go index 01f2e6f36bba..e7df6f1fb7cf 100644 --- a/core/coreapi/interface/tests/path.go +++ b/core/coreapi/interface/tests/path.go @@ -151,7 +151,7 @@ func (tp *provider) TestInvalidPathRemainder(t *testing.T) { } _, err = api.ResolvePath(ctx, p1) - if err == nil || err.Error() != "no such link found" { + if err == nil || !strings.Contains(err.Error(), "no such link found") { t.Fatalf("unexpected error: %s", err) } } diff --git a/core/coreapi/interface/tests/unixfs.go b/core/coreapi/interface/tests/unixfs.go index fce41ae8490e..5e2964f626f2 100644 --- a/core/coreapi/interface/tests/unixfs.go +++ b/core/coreapi/interface/tests/unixfs.go @@ -587,7 +587,7 @@ func (tp *provider) TestAddHashOnly(t *testing.T) { if err == nil { t.Fatal("expected an error") } - if err.Error() != "blockservice: key not found" { + if !strings.Contains(err.Error(),"blockservice: key not found") { t.Errorf("unxepected error: %s", err.Error()) } }