Fix a bunch of errors that could potentially happen because of changes I made to the Dialer

This commit is contained in:
idk
2021-04-15 17:21:41 -04:00
parent d1d2663c42
commit e278de3a66
9 changed files with 95 additions and 107 deletions

View File

@ -10,8 +10,10 @@ import (
func TestClientLookupInvalid(t *testing.T) {
var err error
setup(t)
defer teardown(t)
client, err := NewClientFromOptions(SetDebug(false))
if err != nil {
t.Fatalf("NewDefaultClient() Error: %q\n", err)
}
addr, err := client.Lookup(`!(@#)`)
if addr != "" || err == nil {
@ -25,6 +27,9 @@ func TestClientLookupInvalid(t *testing.T) {
if repErr.Result != ResultKeyNotFound {
t.Errorf("client.Lookup() should throw an ResultKeyNotFound error.\nGot:%+v%s%s\n", repErr, "!=", ResultKeyNotFound)
}
if err := client.Close(); err != nil {
t.Fatalf("client.Close() Error: %q\n", err)
}
}
func TestClientLookupValid(t *testing.T) {