From 59ad100e22eaa4bcccee43502121867d9225c492 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Mon, 12 Jan 2015 09:54:56 +0000 Subject: [PATCH] Need to implement some more verbs as well --- format.go | 6 ++++++ parse_test.go | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/format.go b/format.go index b5f8a1ca..fcc61b67 100644 --- a/format.go +++ b/format.go @@ -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")) } } diff --git a/parse_test.go b/parse_test.go index 759f4df9..e1240f2c 100644 --- a/parse_test.go +++ b/parse_test.go @@ -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) {