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

move txt encode/decode to txtutil

This commit is contained in:
Tom Limoncelli
2023-11-12 14:26:27 -05:00
parent 675a44619d
commit 6448fc5a8e
11 changed files with 41 additions and 240 deletions

View File

@ -1074,7 +1074,7 @@ func makeTests(t *testing.T) []*TestGroup {
// update the AuditRecords().
// Commented this one out. Nobody supports this or needs it.
tc("a 0-byte TXT", txt("foo0", "")),
//tc("a 0-byte TXT", txt("foo0", "")),
tc("a 254-byte TXT", txt("foo254", strings.Repeat("B", 254))),
tc("a 255-byte TXT", txt("foo255", strings.Repeat("C", 255))),
@ -1088,17 +1088,17 @@ func makeTests(t *testing.T) []*TestGroup {
tc("TXT with 1 backtick", txt("foobt", "blah`blah")),
tc("TXT with 1 double-quotes", txt("foodq", `quo"te`)),
tc("TXT with 2 double-quotes", txt("foodqs", `q"uo"te`)),
tc("TXT with 1 backslash", txt("fooosbs", `back\slash`)),
tc("TXT with 1 backslash", txt("fooosbs", `backs\lash`)),
tc("TXT interior ws", txt("foosp", "with spaces")),
tc("TXT trailing ws", txt("foows1", "with space at end ")),
//tc("Create a TXT/SPF", txt("foo", "v=spf1 ip4:99.99.99.99 -all")),
tc("Create a TXT/SPF", txt("foo", "v=spf1 ip4:99.99.99.99 -all")),
// This was added because Vultr syntax-checks TXT records with SPF contents.
//clear(),
// TODO(tlim): Re-add this when we fix the RFC1035 escaped-quotes issue.
tc("Create TXT with frequently escaped characters", txt("fooex", `!^.*$@#%^&()([][{}{<></:;-_=+\`)),
//tc("Create TXT with frequently escaped characters", txt("fooex", `!^.*$@#%^&()([][{}{<></:;-_=+\`)),
//clear(),
),