MCPcopy Create free account
hub / github.com/pires/go-proxyproto / TestCopyFromWrappedConnectionToWrappedConnection

Function TestCopyFromWrappedConnectionToWrappedConnection

protocol_test.go:2033–2045  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2031}
2032
2033func TestCopyFromWrappedConnectionToWrappedConnection(t *testing.T) {
2034 innerConn1 := &testConn{reads: 1}
2035 wrappedConn1 := NewConn(innerConn1)
2036 innerConn2 := &testConn{}
2037 wrappedConn2 := NewConn(innerConn2)
2038
2039 if _, err := io.Copy(wrappedConn1, wrappedConn2); err != nil {
2040 t.Fatalf("err: %v", err)
2041 }
2042 if innerConn1.readFromCalledWith != innerConn2 {
2043 t.Errorf("Expected io.Copy to pass inner source connection to ReadFrom of inner destination connection")
2044 }
2045}
2046
2047func TestDeadlineWrappersDelegate(t *testing.T) {
2048 conn := &deadlineConn{}

Callers

nothing calls this directly

Calls 1

NewConnFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…