summaryrefslogtreecommitdiff
path: root/logcat
diff options
context:
space:
mode:
authorAlon Albert <aalbert@google.com>2022-06-28 09:22:37 -0700
committerTreeHugger Robot <treehugger-gerrit@google.com>2022-06-28 17:15:09 +0000
commit762a4cc69e709154130b145215dc923c823c8803 (patch)
treede0fdd84cf2881e9a377a044fcaada8d33550669 /logcat
parent3d70118891774009e386599e394be12a5ae8a56b (diff)
downloadidea-762a4cc69e709154130b145215dc923c823c8803.tar.gz
Add Exact Filter to getFieldForImplicitOr()
So `tag:foo tag=:bar` will become `(tag:foo | tag=:bar)` Bug: n/a Test: Added Change-Id: Id54ef257776f4dc19d1543776f870b838ae96ed3
Diffstat (limited to 'logcat')
-rw-r--r--logcat/src/com/android/tools/idea/logcat/filters/LogcatFilterParser.kt1
-rw-r--r--logcat/testSrc/com/android/tools/idea/logcat/filters/LogcatFilterParserTest.kt4
2 files changed, 4 insertions, 1 deletions
diff --git a/logcat/src/com/android/tools/idea/logcat/filters/LogcatFilterParser.kt b/logcat/src/com/android/tools/idea/logcat/filters/LogcatFilterParser.kt
index f16318519f9..f0ea3fb802c 100644
--- a/logcat/src/com/android/tools/idea/logcat/filters/LogcatFilterParser.kt
+++ b/logcat/src/com/android/tools/idea/logcat/filters/LogcatFilterParser.kt
@@ -412,6 +412,7 @@ private fun LogcatFilter.getFieldForImplicitOr(index: Int): FilterType {
return when {
this is StringFilter && field != IMPLICIT_LINE -> FilterType(field)
this is RegexFilter -> FilterType(field)
+ this is ExactStringFilter -> FilterType(field)
this is LevelFilter -> FilterType("level")
this is AgeFilter -> FilterType("age")
this == CrashFilter -> FilterType("is")
diff --git a/logcat/testSrc/com/android/tools/idea/logcat/filters/LogcatFilterParserTest.kt b/logcat/testSrc/com/android/tools/idea/logcat/filters/LogcatFilterParserTest.kt
index 90380ed083f..b6c2d8ebdb6 100644
--- a/logcat/testSrc/com/android/tools/idea/logcat/filters/LogcatFilterParserTest.kt
+++ b/logcat/testSrc/com/android/tools/idea/logcat/filters/LogcatFilterParserTest.kt
@@ -253,17 +253,19 @@ class LogcatFilterParserTest {
fun parse_topLevelExpressions_sameKey_or() {
val parser = logcatFilterParser(topLevelSameKeyTreatment = OR)
- assertThat(parser.parse("-tag:ignore1 foo tag:tag1 -tag~:ignore2 bar level:WARN tag~:tag2")).isEqualTo(
+ assertThat(parser.parse("-tag:ignore1 foo tag:tag1 -tag~:ignore2 bar level:WARN tag~:tag2 tag=:tag3 -tag=:ignore3")).isEqualTo(
AndLogcatFilter(
NegatedStringFilter("ignore1", TAG),
StringFilter("foo", IMPLICIT_LINE),
OrLogcatFilter(
StringFilter("tag1", TAG),
RegexFilter("tag2", TAG),
+ ExactStringFilter("tag3", TAG),
),
NegatedRegexFilter("ignore2", TAG),
StringFilter("bar", IMPLICIT_LINE),
LevelFilter(WARN),
+ NegatedExactStringFilter("ignore3", TAG),
)
)
}