test: add a false case test to blockstore parsing
This commit was moved from ipfs/go-ipfs-http-client@75f597aa16c512ec02f549836e998f1fc29a3846
Jorropo committed
Apr 2, 2022 at 04:24 UTC
f2f2109bc1e8f5b9c636597eb7478e0a4ddca427
1 file changed
+8
-5
client/httpapi/errors_test.go
+8
-5
@@ -74,12 +74,15 @@ func TestBlockstoreNotFoundMatchingIPLDErrNotFound(t *testing.T) {
74
"testing: %w the test",
75
"%w is wrong",
76
} {
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
+ }
84
79
- if wrap != "" {
80
- err = fmt.Errorf(wrap, err)
85
+ doParseIpldNotFoundTest(t, err)
86
}
82
-
83
- doParseIpldNotFoundTest(t, err)
87
}
88
}