summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-02-01 17:33:08 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2020-02-03 12:55:54 +0100
commit11a40ab11f72f85e905bdba4d3274870fbcaeaee (patch)
treea195af50ceeae4fbec2f558651aa5dbcf69ebe48 /test
parent8886ea163032fb8bf64211a94c5dc252a4572a9c (diff)
Correctly stop parsing short form arguments on space, also on ?
we have to stop parsing on space so that things like ~ramd64 | ~rall work correctly. aptitude does not stop parsing on ?, but we'll do as it gets very confusing otherwise if you write stuff like ~ramd64?name(foo), and it resolves to ?and(?architecture(amd64?name), (foo))...
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 ca77959e3..84d09351c 100644
--- a/test/libapt/pattern_test.cc
+++ b/test/libapt/pattern_test.cc
@@ -186,6 +186,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("~ramd64 | ~rall", "?or(?architecture(amd64), ?architecture(all))");
+ EXPECT_PATTERN_EQ("~ramd64?name(foo)", "?and(?architecture(amd64), ?name(foo))");
EXPECT_PATTERN_EQ("(?A|?B)?C", "?and(?or(?A, ?B), ?C)");
EXPECT_PATTERN_EQ("?A|?B?C", "?or(?A, ?and(?B, ?C))");