summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-02-01 17:21:40 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2020-02-03 12:55:54 +0100
commit8886ea163032fb8bf64211a94c5dc252a4572a9c (patch)
tree7bfa93c12cc72e488411ca8ba3a5a610dd9fcdb7 /test
parentd6f38436a229dc4421e77b58bf42d07bdb28b808 (diff)
patterns: Implement parsing of (...) groups
Diffstat (limited to 'test')
-rw-r--r--test/libapt/pattern_test.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/libapt/pattern_test.cc b/test/libapt/pattern_test.cc
index d8d962758..ca77959e3 100644
--- a/test/libapt/pattern_test.cc
+++ b/test/libapt/pattern_test.cc
@@ -187,4 +187,8 @@ TEST(TreeParserTest, ParseShortPattern)
EXPECT_PATTERN_EQ("!~F~T | ~T", "?or(?and(?not(?false), ?true), ?true)");
EXPECT_PATTERN_EQ("~ramd64|~rall", "?or(?architecture(amd64), ?architecture(all))");
+ EXPECT_PATTERN_EQ("(?A|?B)?C", "?and(?or(?A, ?B), ?C)");
+ EXPECT_PATTERN_EQ("?A|?B?C", "?or(?A, ?and(?B, ?C))");
+ EXPECT_PATTERN_EQ("?A|(?B?C)", "?or(?A, ?and(?B, ?C))");
+ EXPECT_PATTERN_EQ("(?B?C)|?A", "?or(?and(?B, ?C), ?A)");
}