Home / Function/ Test_Utils_TestConn_Closed_Write() — fiber Function Reference

Test_Utils_TestConn_Closed_Write() — fiber Function Reference

Architecture documentation for the Test_Utils_TestConn_Closed_Write() function in helpers_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  105df7aa_238b_7594_048e_8d5ff365283c["Test_Utils_TestConn_Closed_Write()"]
  c82e3595_b1b8_f596_c097_f26fa40159d1["helpers_test.go"]
  105df7aa_238b_7594_048e_8d5ff365283c -->|defined in| c82e3595_b1b8_f596_c097_f26fa40159d1
  style 105df7aa_238b_7594_048e_8d5ff365283c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

helpers_test.go lines 752–769

func Test_Utils_TestConn_Closed_Write(t *testing.T) {
	t.Parallel()
	conn := &testConn{}

	// Verify write of response
	_, err := conn.Write([]byte("Response 1\n"))
	require.NoError(t, err)

	// Close early, write should fail
	conn.Close() //nolint:errcheck // It is fine to ignore the error here
	_, err = conn.Write([]byte("Response 2\n"))
	require.ErrorIs(t, err, errTestConnClosed)

	res := make([]byte, 11)
	_, err = conn.w.Read(res)
	require.NoError(t, err)
	require.Equal(t, []byte("Response 1\n"), res)
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_Utils_TestConn_Closed_Write() do?
Test_Utils_TestConn_Closed_Write() is a function in the fiber codebase, defined in helpers_test.go.
Where is Test_Utils_TestConn_Closed_Write() defined?
Test_Utils_TestConn_Closed_Write() is defined in helpers_test.go at line 752.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free