This commit is contained in:
Tejal Desai
2020-03-06 13:08:02 -08:00
parent 861c039c8f
commit b4b70d040a
6 changed files with 162 additions and 18 deletions
+6
View File
@@ -68,6 +68,12 @@ func CheckError(t *testing.T, shouldErr bool, err error) {
}
}
func CheckNoError(t *testing.T, err error) {
if err != nil {
t.Error(err)
}
}
func checkErr(shouldErr bool, err error) error {
if err == nil && shouldErr {
return fmt.Errorf("Expected error, but returned none")