(t *testing.T)
| 28 | ) |
| 29 | |
| 30 | func TestQueryString(t *testing.T) { |
| 31 | test := func(ip, queryStr string) { |
| 32 | t.Helper() |
| 33 | |
| 34 | parsed := net.ParseIP(ip) |
| 35 | if parsed == nil { |
| 36 | panic("Malformed IP in test") |
| 37 | } |
| 38 | |
| 39 | actual := queryString(parsed) |
| 40 | if actual != queryStr { |
| 41 | t.Errorf("want queryString(%s) to be %s, got %s", ip, queryStr, actual) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | test("2001:db8:1:2:3:4:567:89ab", "b.a.9.8.7.6.5.0.4.0.0.0.3.0.0.0.2.0.0.0.1.0.0.0.8.b.d.0.1.0.0.2") |
| 46 | test("2001::1:2:3:4:567:89ab", "b.a.9.8.7.6.5.0.4.0.0.0.3.0.0.0.2.0.0.0.1.0.0.0.0.0.0.0.1.0.0.2") |
| 47 | test("192.0.2.99", "99.2.0.192") |
| 48 | } |
| 49 | |
| 50 | func TestCheckDomain(t *testing.T) { |
| 51 | test := func(zones map[string]mockdns.Zone, cfg List, domain string, expectedErr error) { |
nothing calls this directly
no test coverage detected