diff --git a/utils/rsrparser_test.go b/utils/rsrparser_test.go index aea0eadee..dd75d1a1e 100644 --- a/utils/rsrparser_test.go +++ b/utils/rsrparser_test.go @@ -26,13 +26,14 @@ import ( func TestNewRSRParsers(t *testing.T) { ruleStr := `Value1;Heade2=Value2;~Header3(Val3&!Val4);~Header4:s/a/${1}b/{*duration_seconds&*round:2}(b&c);Value5{*duration_seconds&*round:2}` eRSRParsers := RSRParsers{ - &RSRParser{Rules: "Value1", attrValue: "Value1"}, - &RSRParser{Rules: "Heade2=Value2", attrName: "Heade2", attrValue: "Value2"}, - &RSRParser{Rules: "~Header3(Val3&!Val4)", attrName: "Header3", + &RSRParser{Rules: "Value1", AllFiltersMatch: true, attrValue: "Value1"}, + &RSRParser{Rules: "Heade2=Value2", AllFiltersMatch: true, attrName: "Heade2", attrValue: "Value2"}, + &RSRParser{Rules: "~Header3(Val3&!Val4)", AllFiltersMatch: true, attrName: "Header3", filters: RSRFilters{NewRSRFilterMustCompile("Val3"), NewRSRFilterMustCompile("!Val4")}}, - &RSRParser{Rules: "~Header4:s/a/${1}b/{*duration_seconds&*round:2}(b&c)", attrName: "Header4", + &RSRParser{Rules: "~Header4:s/a/${1}b/{*duration_seconds&*round:2}(b&c)", AllFiltersMatch: true, + attrName: "Header4", rsrRules: []*ReSearchReplace{ &ReSearchReplace{ SearchRegexp: regexp.MustCompile(`a`), @@ -43,7 +44,8 @@ func TestNewRSRParsers(t *testing.T) { NewRSRFilterMustCompile("c")}, }, - &RSRParser{Rules: "Value5{*duration_seconds&*round:2}", attrValue: "Value5", + &RSRParser{Rules: "Value5{*duration_seconds&*round:2}", AllFiltersMatch: true, + attrValue: "Value5", converters: DataConverters{NewDataConverterMustCompile("*duration_seconds"), NewDataConverterMustCompile("*round:2")}, },