diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-04-16 05:37:14 -0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-04-16 08:37:14 -0400 |
commit | 6e2cb00008cbf09e556b00f87603797fcaa47e09 (patch) | |
tree | 3c0eb55ff4226a3f024aad373140d1fb860a6404 /vendor/github.com/miekg/dns/scan_test.go | |
parent | bf24f51c4e1cc6286885460672f7f449e8c6f5ef (diff) | |
download | chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.gz chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.bz2 chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.zip |
Depenancy upgrades and movign to dep. (#8630)
Diffstat (limited to 'vendor/github.com/miekg/dns/scan_test.go')
-rw-r--r-- | vendor/github.com/miekg/dns/scan_test.go | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/vendor/github.com/miekg/dns/scan_test.go b/vendor/github.com/miekg/dns/scan_test.go deleted file mode 100644 index e43ad4478..000000000 --- a/vendor/github.com/miekg/dns/scan_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package dns - -import ( - "io/ioutil" - "os" - "strings" - "testing" -) - -func TestParseZoneInclude(t *testing.T) { - - tmpfile, err := ioutil.TempFile("", "dns") - if err != nil { - t.Fatalf("could not create tmpfile for test: %s", err) - } - - if _, err := tmpfile.WriteString("foo\tIN\tA\t127.0.0.1"); err != nil { - t.Fatalf("unable to write content to tmpfile %q: %s", tmpfile.Name(), err) - } - if err := tmpfile.Close(); err != nil { - t.Fatalf("could not close tmpfile %q: %s", tmpfile.Name(), err) - } - - zone := "$ORIGIN example.org.\n$INCLUDE " + tmpfile.Name() - - tok := ParseZone(strings.NewReader(zone), "", "") - for x := range tok { - if x.Error != nil { - t.Fatalf("expected no error, but got %s", x.Error) - } - if x.RR.Header().Name != "foo.example.org." { - t.Fatalf("expected %s, but got %s", "foo.example.org.", x.RR.Header().Name) - } - } - - os.Remove(tmpfile.Name()) - - tok = ParseZone(strings.NewReader(zone), "", "") - for x := range tok { - if x.Error == nil { - t.Fatalf("expected first token to contain an error but it didn't") - } - if !strings.Contains(x.Error.Error(), "failed to open") || - !strings.Contains(x.Error.Error(), tmpfile.Name()) { - t.Fatalf(`expected error to contain: "failed to open" and %q but got: %s`, tmpfile.Name(), x.Error) - } - } -} |