mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-13 11:06:25 +05:00
Add test for inlineFilter (*string_prefix)
This commit is contained in:
committed by
Dan Christian Bogos
parent
808574c2b4
commit
704b48ce8d
@@ -300,4 +300,23 @@ func TestInlineFilterPassFiltersForEvent(t *testing.T) {
|
||||
} else if !pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", true, pass)
|
||||
}
|
||||
failEvent = map[string]interface{}{
|
||||
"Account": "2001",
|
||||
}
|
||||
passEvent = map[string]interface{}{
|
||||
"Account": "1007",
|
||||
}
|
||||
if pass, err := filterS.PassFiltersForEvent("cgrates.org",
|
||||
failEvent, []string{"*string_prefix:Account:10"}); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", false, pass)
|
||||
}
|
||||
if pass, err := filterS.PassFiltersForEvent("cgrates.org",
|
||||
passEvent, []string{"*string_prefix:Account:10"}); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if !pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", true, pass)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user