Add fallthrough statements to switch statement tests

This commit is contained in:
Owen Mansel-Chan
2021-02-03 15:26:07 +00:00
parent a7545cd11b
commit 36fafadda5

View File

@@ -67,7 +67,7 @@ func switchStatementReturningNonNilOnlyWhenConstant(s string) (string, error) {
case getRandomString():
return "no error", nil
case "another string literal":
return "no error", nil
fallthrough
default:
return "no error", nil
}
@@ -77,8 +77,10 @@ func switchStatementReturningNilOnlyWhenConstant(s string) *string {
t := s
switch t {
case "string literal":
fallthrough
case constantGlobalVariable:
return nil
case constantGlobalVariable, "another string literal":
case "another string literal":
str := "matches random string"
return &str
}