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.
20 lines
332 B
Go
20 lines
332 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestCfg(t *testing.T) {
|
|
os.Chdir("example_config")
|
|
c, err := parseCfg("config.json")
|
|
if err != nil {
|
|
t.Fatalf("%s\n", err)
|
|
}
|
|
|
|
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"))
|
|
}
|