From: Sebastian Harl Date: Sun, 6 Apr 2014 11:38:27 +0000 (+0200) Subject: parser_test: Check operator precedence. X-Git-Tag: sysdb-0.1.0~140 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a3d532078f112a7669819506670bd6a0385bb91a;p=sysdb.git parser_test: Check operator precedence. --- diff --git a/t/frontend/parser_test.c b/t/frontend/parser_test.c index 20596ee..705e732 100644 --- a/t/frontend/parser_test.c +++ b/t/frontend/parser_test.c @@ -140,6 +140,20 @@ START_TEST(test_parse_matcher) { "host.name =~ 'pattern' OR " "service.name =~ 'pattern'", -1, MATCHER_OR }, + /* check operator precedence */ + { "host.name = 'name' OR " + "service.name = 'name' AND " + "attribute.name = 'name' OR " + "attribute.foo = 'bar'", -1, MATCHER_OR }, + { "host.name = 'name' AND " + "service.name = 'name' AND " + "attribute.name = 'name' OR " + "attribute.foo = 'bar'", -1, MATCHER_OR }, + { "host.name = 'name' AND " + "service.name = 'name' OR " + "attribute.name = 'name' AND " + "attribute.foo = 'bar'", -1, MATCHER_OR }, + /* syntax errors */ { "LIST", -1, -1 }, { "foo &^ bar", -1, -1 },