mirror of
https://github.com/minio/minio.git
synced 2026-06-04 10:13:48 +08:00
Remove error package and cause functions (#5784)
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -428,3 +429,26 @@ func TestCeilFrac(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Test if isErrIgnored works correctly.
|
||||
func TestIsErrIgnored(t *testing.T) {
|
||||
var errIgnored = fmt.Errorf("ignored error")
|
||||
var testCases = []struct {
|
||||
err error
|
||||
ignored bool
|
||||
}{
|
||||
{
|
||||
err: nil,
|
||||
ignored: false,
|
||||
},
|
||||
{
|
||||
err: errIgnored,
|
||||
ignored: true,
|
||||
},
|
||||
}
|
||||
for i, testCase := range testCases {
|
||||
if ok := IsErrIgnored(testCase.err, errIgnored); ok != testCase.ignored {
|
||||
t.Errorf("Test: %d, Expected %t, got %t", i+1, testCase.ignored, ok)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user