From: Sebastian Harl Date: Tue, 8 Apr 2014 12:29:07 +0000 (+0200) Subject: frontend/parser_test: Cover more basic expressions. X-Git-Tag: sysdb-0.1.0~132^2~20 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=723ce33d539d7089e4bf675eddf724d7d8df76b9;p=sysdb.git frontend/parser_test: Cover more basic expressions. --- diff --git a/t/frontend/parser_test.c b/t/frontend/parser_test.c index 74075b3..f64b9eb 100644 --- a/t/frontend/parser_test.c +++ b/t/frontend/parser_test.c @@ -142,8 +142,22 @@ START_TEST(test_parse_matcher) /* valid expressions */ { "host.name = 'localhost'", -1, MATCHER_HOST }, + { "host.name != 'localhost'", -1, MATCHER_NOT }, + { "host.name =~ 'host'", -1, MATCHER_HOST }, + { "host.name !~ 'host'", -1, MATCHER_NOT }, { "host.name = 'localhost' -- foo", -1, MATCHER_HOST }, { "host.name = 'host' ", 18, MATCHER_HOST }, + /* match hosts by service */ + { "service.name = 'name'", -1, MATCHER_HOST }, + { "service.name != 'name'", -1, MATCHER_NOT }, + { "service.name =~ 'pattern'", -1, MATCHER_HOST }, + { "service.name !~ 'pattern'", -1, MATCHER_NOT }, + /* match hosts by attribute */ + { "attribute.name = 'name'", -1, MATCHER_HOST }, + { "attribute.name != 'name'", -1, MATCHER_NOT }, + { "attribute.name =~ 'pattern'", -1, MATCHER_HOST }, + { "attribute.name !~ 'pattern'", -1, MATCHER_NOT }, + /* composite expressions */ { "host.name =~ 'pattern' AND " "service.name =~ 'pattern'", -1, MATCHER_AND }, { "host.name =~ 'pattern' OR "