You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gdns/cfg_test.go

20 lines
332 B
Go

8 years ago
package main
import (
"fmt"
8 years ago
"os"
8 years ago
"testing"
)
func TestCfg(t *testing.T) {
8 years ago
os.Chdir("example_config")
8 years ago
c, err := parseCfg("config.json")
if err != nil {
t.Fatalf("%s\n", err)
}
8 years ago
8 years ago
fmt.Printf("%+v\n", c)
fmt.Printf("%v\n", c.Rules[0].domains.match("google.com"))
fmt.Printf("%v\n", c.Rules[0].domains.match("www.ip.cn"))
}