Adding assertMatchesMultiLine() to SecurityTestCase
Test: successful build
Bug: 112663496
Change-Id: I84841e9dbfe5788d5c12a1230f0cbb451cbb1718
Signed-off-by: Mikhail Maryakhin <mmaryakhin@google.com>
diff --git a/hostsidetests/security/src/android/security/cts/SecurityTestCase.java b/hostsidetests/security/src/android/security/cts/SecurityTestCase.java
index 4db7633..666bb09 100644
--- a/hostsidetests/security/src/android/security/cts/SecurityTestCase.java
+++ b/hostsidetests/security/src/android/security/cts/SecurityTestCase.java
@@ -182,14 +182,18 @@
assertTrue("Pattern not found", Pattern.matches(pattern, input));
}
+ public void assertMatchesMultiLine(String pattern, String input) throws Exception {
+ assertTrue("Pattern not found: " + pattern,
+ Pattern.compile(pattern).matcher(input).find());
+ }
+
public void assertNotMatches(String pattern, String input) throws Exception {
assertFalse("Pattern found", Pattern.matches(pattern, input));
}
public void assertNotMatchesMultiLine(String pattern, String input) throws Exception {
- assertFalse("Pattern found",
- Pattern.compile(pattern,
- Pattern.DOTALL).matcher(input).matches());
+ assertFalse("Pattern found: " + pattern,
+ Pattern.compile(pattern).matcher(input).find());
}
// Flag meaning the test will likely fail on devices with low memory.