summaryrefslogtreecommitdiff
path: root/tests/test_matching.cc
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2008-10-02 06:42:36 -0700
committerDaniel Burrows <dburrows@debian.org>2008-10-02 06:42:36 -0700
commitd58ce0592dd2f42cc918ddafd12e554bec84879f (patch)
tree2d8f6ab3c39a155baada2bbfab0b5c98c8d44f69 /tests/test_matching.cc
parent0d4e0f66d900aa3a3d990a8d01a1c52123ab18d8 (diff)
downloadaptitude-d58ce0592dd2f42cc918ddafd12e554bec84879f.tar.gz
Add a test for order-of-operations when serializing OR inside AND.
Diffstat (limited to 'tests/test_matching.cc')
-rw-r--r--tests/test_matching.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_matching.cc b/tests/test_matching.cc
index bacf97e0..1b6913a9 100644
--- a/tests/test_matching.cc
+++ b/tests/test_matching.cc
@@ -474,6 +474,18 @@ namespace
pattern::make_and(pattern::make_obsolete(),
pattern::make_obsolete()) },
+ { "?and(?term(apt), ?or(?term(gui), ?installed))",
+ "?term(\"apt\") (?term(\"gui\") | ?installed)",
+ pattern::make_and(pattern::make_term("apt"),
+ pattern::make_or(pattern::make_term("gui"),
+ pattern::make_installed())) },
+
+ { "?and(?or(?term(gui), ?installed), ?term(apt))",
+ "(?term(\"gui\") | ?installed) ?term(\"apt\")",
+ pattern::make_and(pattern::make_or(pattern::make_term("gui"),
+ pattern::make_installed()),
+ pattern::make_term("apt")) },
+
{ "?or(~nasdf, ?new)", "?name(\"asdf\") | ?new",
pattern::make_or(pattern::make_name("asdf"),
pattern::make_new()) },