Merge "Add AssertStringListContains to TestHelper" am: 01c76ca278 am: f2def2fc4e

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1626510

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8e655f2059f13468aaf821addac0d45edd409491
This commit is contained in:
Paul Duffin
2021-03-11 15:20:33 +00:00
committed by Automerger Merge Worker

View File

@@ -581,6 +581,16 @@ func (h *TestHelper) AssertStringDoesNotContain(message string, s string, unexpe
} }
} }
// AssertStringListContains checks if the list of strings contains the expected string. If it does
// not then it reports an error prefixed with the supplied message and including a reason for why it
// failed.
func (h *TestHelper) AssertStringListContains(message string, list []string, expected string) {
h.Helper()
if !InList(expected, list) {
h.Errorf("%s: could not find %q within %q", message, expected, list)
}
}
// AssertArrayString checks if the expected and actual values are equal and if they are not then it // AssertArrayString checks if the expected and actual values are equal and if they are not then it
// reports an error prefixed with the supplied message and including a reason for why it failed. // reports an error prefixed with the supplied message and including a reason for why it failed.
func (h *TestHelper) AssertArrayString(message string, expected, actual []string) { func (h *TestHelper) AssertArrayString(message string, expected, actual []string) {