fix(model): TXT сравнивается байт-точно (без схлопывания пробелов)

This commit is contained in:
2026-07-03 12:57:24 +07:00
parent 9b38f081f4
commit b50972f38d
2 changed files with 11 additions and 2 deletions
+8
View File
@@ -99,6 +99,14 @@ func TestEqualTXTCaseSensitive(t *testing.T) {
}
}
func TestEqualTXTWhitespaceSignificant(t *testing.T) {
a := Record{Type: TXT, Name: "example.com.", TTL: 60, Values: []string{"v=spf1 a"}}
b := Record{Type: TXT, Name: "example.com.", TTL: 60, Values: []string{"v=spf1 a"}}
if a.Equal(b) {
t.Fatal("TXT records differing only in whitespace count must not be equal (byte-exact comparison)")
}
}
func TestEqualTTLMatters(t *testing.T) {
a := Record{Type: A, Name: "example.com.", TTL: 300, Values: []string{"1.2.3.4"}}
b := Record{Type: A, Name: "example.com.", TTL: 600, Values: []string{"1.2.3.4"}}