Files
ddns-go/config_test.go
jeessy2 38d6aa7baf init
2020-08-26 17:38:43 +08:00

22 lines
303 B
Go

package main
import (
"io/ioutil"
"testing"
"gopkg.in/yaml.v2"
)
func TestConfig(t *testing.T) {
conf := &Config{}
byt, err := ioutil.ReadFile("config.yaml")
if err != nil {
t.Error(err)
}
yaml.Unmarshal(byt, conf)
if "alidns" != conf.DNS.Name {
t.Error("DNS Name必须为alidns")
}
}