Add AssertStringListContains to TestHelper
Bug: 181070625
Test: m nothing
Change-Id: I5b36b748a2f0b7c189aa9e12cf0ad0f663c92a9a
diff --git a/android/fixture.go b/android/fixture.go
index 1def9c0..25dee27 100644
--- a/android/fixture.go
+++ b/android/fixture.go
@@ -581,6 +581,16 @@
}
}
+// 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
// 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) {