simplify dns.MockResolver, changing MockReq to just a string representing the request

similar to Authentic/Inauthentic
This commit is contained in:
Mechiel Lukkien
2023-10-12 16:07:25 +02:00
parent c095f3f39c
commit 7dce883097
10 changed files with 57 additions and 54 deletions

View File

@ -22,8 +22,8 @@ func TestLookup(t *testing.T) {
"nonspf.example.": {"something else"},
"ok.example.": {"v=spf1"},
},
Fail: map[dns.Mockreq]struct{}{
{Type: "txt", Name: "temperror.example."}: {},
Fail: []string{
"txt temperror.example.",
},
}
@ -245,7 +245,6 @@ func TestVerify(t *testing.T) {
{Host: "mail-c.example.org.", Pref: 10},
},
},
Fail: map[dns.Mockreq]struct{}{},
}
ctx := context.Background()
@ -441,8 +440,8 @@ func TestVerifyScenarios(t *testing.T) {
"2001:db8::1": {"mail.mox.example."},
"10.0.1.1": {"mx1.many-mx.example.", "mx2.many-mx.example.", "mx3.many-mx.example.", "mx4.many-mx.example.", "mx5.many-mx.example.", "mx6.many-mx.example.", "mx7.many-mx.example.", "mx8.many-mx.example.", "mx9.many-mx.example.", "mx10.many-mx.example.", "mx11.many-mx.example."},
},
Fail: map[dns.Mockreq]struct{}{
{Type: "txt", Name: "temperror.example."}: {},
Fail: []string{
"txt temperror.example.",
},
}