From 7e792338bb1033a90c82c538a80a0c52654891a1 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sun, 21 Sep 2014 07:56:01 +0100 Subject: [PATCH] Move custom* filenames to private to be in sync with the type --- customrr.go => privaterr.go | 0 customrrex_test.go => privaterr_ex_test.go | 0 customrr_test.go => privaterr_test.go | 15 +++++++-------- 3 files changed, 7 insertions(+), 8 deletions(-) rename customrr.go => privaterr.go (100%) rename customrrex_test.go => privaterr_ex_test.go (100%) rename customrr_test.go => privaterr_test.go (91%) diff --git a/customrr.go b/privaterr.go similarity index 100% rename from customrr.go rename to privaterr.go diff --git a/customrrex_test.go b/privaterr_ex_test.go similarity index 100% rename from customrrex_test.go rename to privaterr_ex_test.go diff --git a/customrr_test.go b/privaterr_test.go similarity index 91% rename from customrr_test.go rename to privaterr_test.go index f835e5ed..7b0a1a46 100644 --- a/customrr_test.go +++ b/privaterr_test.go @@ -1,4 +1,4 @@ -package dns_test +package dns import ( "github.com/miekg/dns" @@ -6,10 +6,9 @@ import ( "testing" ) -const TypeISBN uint16 = 0x0F01 - -// sorry DNS RFC writers, here we go with crazy idea test :) +const typeISBN uint16 = 0x0F01 +// A crazy new RR type :) type ISBN struct { x string // rdata with 10 or 13 numbers, dashes or spaces allowed } @@ -60,7 +59,7 @@ func TestPrivateText(t *testing.T) { t.Fatal(err) } if rr.String() != testrecord { - t.Errorf("Record string representation did not match original %#v != %#v", rr.String(), testrecord) + t.Errorf("record string representation did not match original %#v != %#v", rr.String(), testrecord) } else { t.Log(rr.String()) } @@ -78,17 +77,17 @@ func TestPrivateByteSlice(t *testing.T) { buf := make([]byte, 100) off, err := dns.PackRR(rr, buf, 0, nil, false) if err != nil { - t.Errorf("Got error packing ISBN: %s", err) + t.Errorf("got error packing ISBN: %s", err) } custrr := rr.(*dns.PrivateRR) if ln := custrr.Data.RdataLen() + len(custrr.Header().Name) + 11; ln != off { - t.Errorf("Offset is not matching to length of Private RR: %d!=%d", off, ln) + t.Errorf("offset is not matching to length of Private RR: %d!=%d", off, ln) } rr1, off1, err := dns.UnpackRR(buf[:off], 0) if err != nil { - t.Errorf("Got error unpacking ISBN: %s", err) + t.Errorf("got error unpacking ISBN: %s", err) } if off1 != off {