Home / Function/ Test_ReadContentReturnsBytes() — fiber Function Reference

Test_ReadContentReturnsBytes() — fiber Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

helpers_test.go lines 116–135

func Test_ReadContentReturnsBytes(t *testing.T) {
	t.Parallel()

	content := []byte("fiber read content test")
	tempFile, err := os.CreateTemp("", "fiber-read-content-*.txt")
	require.NoError(t, err)
	t.Cleanup(func() {
		require.NoError(t, os.Remove(tempFile.Name()))
	})

	_, err = tempFile.Write(content)
	require.NoError(t, err)
	require.NoError(t, tempFile.Close())

	var buffer bytes.Buffer
	n, err := readContent(&buffer, tempFile.Name())
	require.NoError(t, err)
	require.Equal(t, int64(len(content)), n)
	require.Equal(t, content, buffer.Bytes())
}

Domain

Subdomains

Defined In

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free