Blame


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