From 723ce33d539d7089e4bf675eddf724d7d8df76b9 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 8 Apr 2014 14:29:07 +0200 Subject: [PATCH] frontend/parser_test: Cover more basic expressions. --- 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 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 " -- 2.30.2