From fc8afa48780ac17e2d69aa7cc6191b3715322c26 Mon Sep 17 00:00:00 2001 From: Richardas Kuchinskas <36065987+Hidanio@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:34:11 +0300 Subject: [PATCH] dynamic rules: `path-exclude` rule fix (#1222) --- src/rules/parser.go | 1 + src/tests/rules/rules_test.go | 48 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/src/rules/parser.go b/src/rules/parser.go index 3eb6fd3e0..0e9e9be64 100644 --- a/src/rules/parser.go +++ b/src/rules/parser.go @@ -142,6 +142,7 @@ func (p *parser) parseRuleInfo(st ir.Node, labelStmt ir.Node, proto *Rule) (Rule rule.Message = proto.Message rule.Location = proto.Location rule.Path = proto.Path + rule.PathExcludes = proto.PathExcludes rule.Filters = make([]map[string]Filter, len(proto.Filters)) for i, filterSet := range proto.Filters { diff --git a/src/tests/rules/rules_test.go b/src/tests/rules/rules_test.go index da0c77f5b..cb8633371 100644 --- a/src/tests/rules/rules_test.go +++ b/src/tests/rules/rules_test.go @@ -488,3 +488,51 @@ function type_type_check(string $animal_name, int $animal_id) { } test.RunRulesTest() } + +func TestRulePathExcludePositive(t *testing.T) { + rfile := `