From a3d532078f112a7669819506670bd6a0385bb91a Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 6 Apr 2014 13:38:27 +0200 Subject: [PATCH] parser_test: Check operator precedence. --- t/frontend/parser_test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 }, -- 2.30.2