|
|
|
@ -562,7 +562,7 @@ func TestAddrs(t *testing.T) {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestUnderlyingConn(t *testing.T) { |
|
|
|
|
func TestDeprecatedUnderlyingConn(t *testing.T) { |
|
|
|
|
var b1, b2 bytes.Buffer |
|
|
|
|
fc := fakeNetConn{Reader: &b1, Writer: &b2} |
|
|
|
|
c := newConn(fc, true, 1024, 1024, nil, nil, nil) |
|
|
|
@ -572,6 +572,16 @@ func TestUnderlyingConn(t *testing.T) {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestNetConn(t *testing.T) { |
|
|
|
|
var b1, b2 bytes.Buffer |
|
|
|
|
fc := fakeNetConn{Reader: &b1, Writer: &b2} |
|
|
|
|
c := newConn(fc, true, 1024, 1024, nil, nil, nil) |
|
|
|
|
ul := c.NetConn() |
|
|
|
|
if ul != fc { |
|
|
|
|
t.Fatalf("Underlying conn is not what it should be.") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestBufioReadBytes(t *testing.T) { |
|
|
|
|
// Test calling bufio.ReadBytes for value longer than read buffer size.
|
|
|
|
|
|
|
|
|
|