test: add a false case test to blockstore parsing

This commit was moved from ipfs/go-ipfs-http-client@75f597aa16
This commit is contained in:
Jorropo 2022-04-02 04:24:12 +02:00
parent 54f6e90870
commit f2f2109bc1

View File

@ -74,12 +74,15 @@ func TestBlockstoreNotFoundMatchingIPLDErrNotFound(t *testing.T) {
"testing: %w the test",
"%w is wrong",
} {
var err error = blockstoreNotFoundMatchingIPLDErrNotFound{"blockstore: block not found"}
for _, err := range [...]error{
errors.New("network connection timeout"),
blockstoreNotFoundMatchingIPLDErrNotFound{"blockstore: block not found"},
} {
if wrap != "" {
err = fmt.Errorf(wrap, err)
}
if wrap != "" {
err = fmt.Errorf(wrap, err)
doParseIpldNotFoundTest(t, err)
}
doParseIpldNotFoundTest(t, err)
}
}