Add missing tests for bucket util (#565)

* Add CheckDeepEqual test util

* Fix for srcContext with slash suffix

* Add tests for bucket_util.go
This commit is contained in:
Shuhei Kitagawa
2019-02-19 09:05:23 -06:00
committed by dlorenc
parent 4feed0ff35
commit e8564f0d28
3 changed files with 76 additions and 1 deletions
+8
View File
@@ -41,6 +41,14 @@ func SetupFiles(path string, files map[string]string) error {
return nil
}
func CheckDeepEqual(t *testing.T, expected, actual interface{}) {
t.Helper()
if diff := cmp.Diff(actual, expected); diff != "" {
t.Errorf("%T differ (-got, +want): %s", expected, diff)
return
}
}
func CheckErrorAndDeepEqual(t *testing.T, shouldErr bool, err error, expected, actual interface{}) {
t.Helper()
if err := checkErr(shouldErr, err); err != nil {