Need to implement some more verbs as well

This commit is contained in:
Miek Gieben 2015-01-12 09:54:56 +00:00
parent a8e252952e
commit 59ad100e22
2 changed files with 13 additions and 0 deletions

View File

@ -62,6 +62,9 @@ func format(r RR, f fmt.State, c rune) {
f.Write([]byte(Type(r.Header().Rrtype).String()))
case 's':
f.Write([]byte(r.String()))
default:
println(string(c))
f.Write([]byte("TODO"))
}
}
@ -77,6 +80,9 @@ func format_Header(h *RR_Header, f fmt.State, c rune) {
f.Write([]byte(Type(h.Rrtype).String()))
case 's':
f.Write([]byte(h.String()))
default:
println(string(c))
f.Write([]byte("TODO"))
}
}

View File

@ -1358,6 +1358,13 @@ func TestPrintfVerbs(t *testing.T) {
if fmt.Sprintf("%s", x) != "www.miek.nl.\t3600\tIN\tA\t127.0.0.1" {
t.Errorf("%%s does return the correct string")
}
if fmt.Sprintf("%T", x) != "*dns.A" {
t.Errorf("%%T does return the correct string")
}
if fmt.Sprintf("%v", x) != "" {
t.Errorf("%v", x)
t.Errorf("%%v does return the correct string")
}
}
func TestPrintfVerbsRdata(t *testing.T) {