Skip to content
This repository was archived by the owner on Oct 5, 2023. It is now read-only.

Commit 75f597a

Browse files
committed
test: add a false case test to blockstore parsing
1 parent a3b4935 commit 75f597a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

errors_test.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,15 @@ func TestBlockstoreNotFoundMatchingIPLDErrNotFound(t *testing.T) {
7474
"testing: %w the test",
7575
"%w is wrong",
7676
} {
77-
var err error = blockstoreNotFoundMatchingIPLDErrNotFound{"blockstore: block not found"}
77+
for _, err := range [...]error{
78+
errors.New("network connection timeout"),
79+
blockstoreNotFoundMatchingIPLDErrNotFound{"blockstore: block not found"},
80+
} {
81+
if wrap != "" {
82+
err = fmt.Errorf(wrap, err)
83+
}
7884

79-
if wrap != "" {
80-
err = fmt.Errorf(wrap, err)
85+
doParseIpldNotFoundTest(t, err)
8186
}
82-
83-
doParseIpldNotFoundTest(t, err)
8487
}
8588
}

0 commit comments

Comments
 (0)