diff options
author | Alon Albert <aalbert@google.com> | 2022-06-28 09:22:37 -0700 |
---|---|---|
committer | TreeHugger Robot <treehugger-gerrit@google.com> | 2022-06-28 17:15:09 +0000 |
commit | 762a4cc69e709154130b145215dc923c823c8803 (patch) | |
tree | de0fdd84cf2881e9a377a044fcaada8d33550669 /logcat | |
parent | 3d70118891774009e386599e394be12a5ae8a56b (diff) | |
download | idea-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.kt | 1 | ||||
-rw-r--r-- | logcat/testSrc/com/android/tools/idea/logcat/filters/LogcatFilterParserTest.kt | 4 |
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), ) ) } |