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

moving a bunch of packages under pkg (#124)

* moving a bunch of packages under pkg

* fix gen

* fix tst

* oops

* fix test fo real

* parse mx/a
This commit is contained in:
Craig Peterson
2017-05-25 14:25:39 -04:00
committed by GitHub
parent 01a242480c
commit 42ef9f4b9e
49 changed files with 140 additions and 49 deletions

30
pkg/spflib/parse_test.go Normal file
View File

@ -0,0 +1,30 @@
package spflib
import (
"strings"
"testing"
"github.com/StackExchange/dnscontrol/pkg/dnsresolver"
)
func TestParse(t *testing.T) {
dnsres, err := dnsresolver.NewResolverPreloaded("testdata-dns1.json")
if err != nil {
t.Fatal(err)
}
rec, err := Parse(strings.Join([]string{"v=spf1",
"ip4:198.252.206.0/24",
"ip4:192.111.0.0/24",
"include:_spf.google.com",
"include:mailgun.org",
"include:spf-basic.fogcreek.com",
"include:mail.zendesk.com",
"include:servers.mcsv.net",
"include:sendgrid.net",
"include:spf.mtasv.net",
"~all"}, " "), dnsres)
if err != nil {
t.Fatal(err)
}
DumpSPF(rec, "")
}