1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

adding mx and cname

This commit is contained in:
Craig Peterson
2017-04-11 23:02:57 -06:00
parent ff6c4289fa
commit fc0cac7d29
4 changed files with 50 additions and 17 deletions

View File

@ -67,21 +67,17 @@ func TestParsedFiles(t *testing.T) {
}
func TestErrors(t *testing.T) {
files, err := ioutil.ReadDir(errorDir)
if err != nil {
t.Fatal(err)
tests := []struct{ desc, text string }{
{"old dsp style", `D("foo.com","reg","dsp")`},
{"MX no priority", `D("foo.com","reg",MX("@","test."))`},
{"MX reversed", `D("foo.com","reg",MX("@","test.", 5))`},
}
for _, f := range files {
if filepath.Ext(f.Name()) != ".js" {
continue
}
t.Log(f.Name(), "------")
content, err := ioutil.ReadFile(filepath.Join(errorDir, f.Name()))
if err != nil {
t.Fatal(err)
}
if _, err = ExecuteJavascript(string(content), true); err == nil {
t.Fatal("Expected error but found none")
}
for _, tst := range tests {
t.Run(tst.desc, func(t *testing.T) {
if _, err := ExecuteJavascript(tst.text, true); err == nil {
t.Fatal("Expected error but found none")
}
})
}
}