summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-12-07 15:04:30 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2020-12-07 15:11:20 +0100
commitf9a621d335622a8909177f6d347e32e3876fde3f (patch)
treec6d915fdba268e745c34f36b6290460e14c229b5 /test
parentd63772845a28a08ea9c812ad8ac281cf9e0ae12a (diff)
patterns: Terminate short pattern by ~ and !
This allows patterns like ~nalpha~nbeta and ~nalpha!~nbeta to work like they do in APT. Also add a comment to remind readers that everything in START should be in short too. Cc: stable >= 2.0
Diffstat (limited to 'test')
-rw-r--r--test/libapt/pattern_test.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/libapt/pattern_test.cc b/test/libapt/pattern_test.cc
index bfcaf2093..55bc4bdcf 100644
--- a/test/libapt/pattern_test.cc
+++ b/test/libapt/pattern_test.cc
@@ -219,4 +219,6 @@ TEST(TreeParserTest, ParseShortPattern)
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)");
+ EXPECT_PATTERN_EQ("~napt~nfoo", "?and(?name(apt),?name(foo))");
+ EXPECT_PATTERN_EQ("~napt!~nfoo", "?and(?name(apt),?not(?name(foo)))");
}