Blob


1 package icinga
3 import "testing"
5 func TestFilterEncode(t *testing.T) {
6 expr := `match("*.example.com"), host.name) && "test" in host.groups`
7 want := "filter=match%28%22%2A.example.com%22%29%2C%20host.name%29%20%26%26%20%22test%22%20in%20host.groups"
8 got := filterEncode(expr)
9 if want != got {
10 t.Fail()
11 }
12 t.Logf("want %s, got %s", want, got)
13 }