From 590bf87003e648fd4aa68280c5840923b400a33b Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 31 Oct 2014 17:13:20 +0100 Subject: [PATCH] store_lookup_test: Ensure that filters are applied before matchers. --- t/unit/core/store_lookup_test.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/unit/core/store_lookup_test.c b/t/unit/core/store_lookup_test.c index 931c4f2..698226e 100644 --- a/t/unit/core/store_lookup_test.c +++ b/t/unit/core/store_lookup_test.c @@ -538,6 +538,8 @@ START_TEST(test_scan) "NOT attribute['x'] = ''", 2 }, /* filter always matches */ { "ANY metric =~ 'm'", NULL, 2 }, { "ALL metric =~ 'm'", NULL, 3 }, + { "ANY metric =~ 'm'", "name !~ '1'", 1 }, + { "ANY metric =~ 'm'", "name !~ 'm'", 0 }, { "ALL metric =~ '1'", NULL, 2 }, { "ALL metric =~ '2'", NULL, 1 }, { "ANY metric !~ 'm'", NULL, 0 }, @@ -548,18 +550,26 @@ START_TEST(test_scan) { "ANY service = 's1'", "NOT attribute['x'] = ''", 2 }, /* filter always matches */ { "ANY service =~ 's'", NULL, 2 }, + { "ANY service =~ 's'", "name !~ 's'", 0 }, + { "ANY service =~ 's'", "name !~ '1'", 2 }, { "ANY service !~ 's'", NULL, 0 }, { "ANY attribute = 'k1'", NULL, 2 }, { "ANY attribute = 'k1'", "host = 'x'",0 }, /* filter never matches */ { "ANY attribute = 'k1'", "NOT attribute['x'] = ''", 2 }, /* filter always matches */ { "ANY attribute =~ 'k'", NULL, 2 }, + { "ANY attribute =~ 'k'", + "name !~ '1'", 1 }, + { "ANY attribute =~ 'k'", + "name !~ 'k'", 0 }, { "ANY attribute =~ '1'", NULL, 2 }, { "ANY attribute =~ '2'", NULL, 1 }, { "ANY attribute = 'x'", NULL, 0 }, { "ANY attribute =~ 'x'", NULL, 0 }, { "ALL attribute = 'k1'", NULL, 2 }, { "attribute['k1'] = 'v1'", NULL, 1 }, + { "attribute['k1'] = 'v1'", + "name != 'k1'", 0 }, { "attribute['k1'] =~ 'v1'", NULL, 1 }, { "attribute['k1'] =~ '^v1$'", NULL, 1 }, { "attribute['k1'] =~ 'v'", NULL, 2 }, -- 2.30.2