Skip to content

Commit

Permalink
More server coverage improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
oxtoacart committed Dec 3, 2014
1 parent 39e728d commit 56fa25d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion domainfronted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ func TestBadCertificateFile(t *testing.T) {
}

func TestNonGlobalAddress(t *testing.T) {
doTestNonGlobalAddress(t, true)
}

func TestNonGlobalAddressBadAddr(t *testing.T) {
doTestNonGlobalAddress(t, false)
}

func doTestNonGlobalAddress(t *testing.T, useRealAddress bool) {
l := startServer(t, false)
client := clientFor(t, l)
defer client.Close()
Expand All @@ -86,7 +94,11 @@ func TestNonGlobalAddress(t *testing.T) {
gotConnMutex.Unlock()
}()

conn, err := client.Dial("tcp", l.Addr().String())
addr := l.Addr().String()
if !useRealAddress {
addr = "asdflklsdkfjhladskfjhlasdkfjhlsads.asflkjshadlfkadsjhflk:0"
}
conn, err := client.Dial("tcp", addr)
defer conn.Close()

data := []byte("Some Meaningless Data")
Expand Down

0 comments on commit 56fa25d

Please sign in to comment.