|
@@ -77,12 +77,12 @@ nameserver 1.2.3.4 # not 4.3.2.1`: {"1.2.3.4/32"},
|
|
|
|
|
|
func TestGetSearchDomains(t *testing.T) {
|
|
func TestGetSearchDomains(t *testing.T) {
|
|
for resolv, result := range map[string][]string{
|
|
for resolv, result := range map[string][]string{
|
|
- `search example.com`: {"example.com"},
|
|
|
|
- `search example.com # ignored`: {"example.com"},
|
|
|
|
- ` search example.com `: {"example.com"},
|
|
|
|
- ` search example.com # ignored`: {"example.com"},
|
|
|
|
- `search foo.example.com example.com`: {"foo.example.com", "example.com"},
|
|
|
|
- ` search foo.example.com example.com `: {"foo.example.com", "example.com"},
|
|
|
|
|
|
+ `search example.com`: {"example.com"},
|
|
|
|
+ `search example.com # ignored`: {"example.com"},
|
|
|
|
+ ` search example.com `: {"example.com"},
|
|
|
|
+ ` search example.com # ignored`: {"example.com"},
|
|
|
|
+ `search foo.example.com example.com`: {"foo.example.com", "example.com"},
|
|
|
|
+ ` search foo.example.com example.com `: {"foo.example.com", "example.com"},
|
|
` search foo.example.com example.com # ignored`: {"foo.example.com", "example.com"},
|
|
` search foo.example.com example.com # ignored`: {"foo.example.com", "example.com"},
|
|
``: {},
|
|
``: {},
|
|
`# ignored`: {},
|
|
`# ignored`: {},
|
|
@@ -104,13 +104,13 @@ nameserver 4.30.20.100`: {"foo.example.com", "example.com"},
|
|
|
|
|
|
func TestGetOptions(t *testing.T) {
|
|
func TestGetOptions(t *testing.T) {
|
|
for resolv, result := range map[string][]string{
|
|
for resolv, result := range map[string][]string{
|
|
- `options opt1`: {"opt1"},
|
|
|
|
- `options opt1 # ignored`: {"opt1"},
|
|
|
|
- ` options opt1 `: {"opt1"},
|
|
|
|
- ` options opt1 # ignored`: {"opt1"},
|
|
|
|
- `options opt1 opt2 opt3`: {"opt1", "opt2", "opt3"},
|
|
|
|
- `options opt1 opt2 opt3 # ignored`: {"opt1", "opt2", "opt3"},
|
|
|
|
- ` options opt1 opt2 opt3 `: {"opt1", "opt2", "opt3"},
|
|
|
|
|
|
+ `options opt1`: {"opt1"},
|
|
|
|
+ `options opt1 # ignored`: {"opt1"},
|
|
|
|
+ ` options opt1 `: {"opt1"},
|
|
|
|
+ ` options opt1 # ignored`: {"opt1"},
|
|
|
|
+ `options opt1 opt2 opt3`: {"opt1", "opt2", "opt3"},
|
|
|
|
+ `options opt1 opt2 opt3 # ignored`: {"opt1", "opt2", "opt3"},
|
|
|
|
+ ` options opt1 opt2 opt3 `: {"opt1", "opt2", "opt3"},
|
|
` options opt1 opt2 opt3 # ignored`: {"opt1", "opt2", "opt3"},
|
|
` options opt1 opt2 opt3 # ignored`: {"opt1", "opt2", "opt3"},
|
|
``: {},
|
|
``: {},
|
|
`# ignored`: {},
|
|
`# ignored`: {},
|