test: fail early on err to avoid an unrelated panic

parent 7bbf5bb0
...@@ -156,7 +156,7 @@ func (tp *TestSuite) TestBlockRm(t *testing.T) { ...@@ -156,7 +156,7 @@ func (tp *TestSuite) TestBlockRm(t *testing.T) {
_, err = api.Block().Get(ctx, res.Path()) _, err = api.Block().Get(ctx, res.Path())
if err == nil { if err == nil {
t.Error("expected err to exist") t.Fatal("expected err to exist")
} }
if !strings.Contains(err.Error(), "blockservice: key not found") { if !strings.Contains(err.Error(), "blockservice: key not found") {
t.Errorf("unexpected error; %s", err.Error()) t.Errorf("unexpected error; %s", err.Error())
...@@ -164,7 +164,7 @@ func (tp *TestSuite) TestBlockRm(t *testing.T) { ...@@ -164,7 +164,7 @@ func (tp *TestSuite) TestBlockRm(t *testing.T) {
err = api.Block().Rm(ctx, res.Path()) err = api.Block().Rm(ctx, res.Path())
if err == nil { if err == nil {
t.Error("expected err to exist") t.Fatal("expected err to exist")
} }
if !strings.Contains(err.Error(), "blockstore: block not found") { if !strings.Contains(err.Error(), "blockstore: block not found") {
t.Errorf("unexpected error; %s", err.Error()) t.Errorf("unexpected error; %s", err.Error())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment