mirror of
https://github.com/safing/portmaster.git
synced 2026-12-05 10:03:06 +00:00
53eb309e72
Also, fix caching issues and add more tests
28 lines
502 B
Go
28 lines
502 B
Go
package resolver
|
|
|
|
import "testing"
|
|
|
|
func TestNameRecordStorage(t *testing.T) {
|
|
testDomain := "Mk35mMqOWEHXSMk11MYcbjLOjTE8PQvDiAVUxf4BvwtgR.example.com."
|
|
testQuestion := "A"
|
|
|
|
testNameRecord := &NameRecord{
|
|
Domain: testDomain,
|
|
Question: testQuestion,
|
|
}
|
|
|
|
err := testNameRecord.Save()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
r, err := GetNameRecord(testDomain, testQuestion)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
if r.Domain != testDomain || r.Question != testQuestion {
|
|
t.Fatal("mismatch")
|
|
}
|
|
}
|