Home / File/ memory_test.go — fiber Source File

memory_test.go — fiber Source File

Architecture documentation for memory_test.go, a go file in the fiber codebase. 1 imports, 0 dependents.

File go InternalStorage MemoryStore 1 imports 26 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  5fc515d5_e762_b957_5588_68b2d14010d3["memory_test.go"]
  cc7104af_aece_1fe5_3985_791c7f34910c["context"]
  5fc515d5_e762_b957_5588_68b2d14010d3 --> cc7104af_aece_1fe5_3985_791c7f34910c
  style 5fc515d5_e762_b957_5588_68b2d14010d3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

package memory

import (
	"context"
	"testing"
	"time"

	"github.com/stretchr/testify/require"
)

func Test_Storage_Memory_Set(t *testing.T) {
	t.Parallel()
	var (
		testStore = New()
		key       = "john"
		val       = []byte("doe")
	)

	err := testStore.Set(key, val, 0)
	require.NoError(t, err)

	keys, err := testStore.Keys()
	require.NoError(t, err)
	require.Len(t, keys, 1)
}

func Test_Storage_Memory_SetWithContext(t *testing.T) {
	t.Parallel()
	var (
		testStore = New()
		key       = "john"
		val       = []byte("doe")
	)

	ctx, cancel := context.WithCancel(context.Background())
	cancel()

	err := testStore.SetWithContext(ctx, key, val, 0)
	require.ErrorIs(t, err, context.Canceled)

	keys, err := testStore.Keys()
	require.NoError(t, err)
	require.Nil(t, keys)
}

func Test_Storage_Memory_Set_Override(t *testing.T) {
	t.Parallel()
	var (
		testStore = New()
		key       = "john"
		val       = []byte("doe")
	)

	err := testStore.Set(key, val, 0)
	require.NoError(t, err)

	err = testStore.Set(key, val, 0)
	require.NoError(t, err)

	keys, err := testStore.Keys()
// ... (402 more lines)

Subdomains

Classes

Dependencies

  • context

Frequently Asked Questions

What does memory_test.go do?
memory_test.go is a source file in the fiber codebase, written in go. It belongs to the InternalStorage domain, MemoryStore subdomain.
What functions are defined in memory_test.go?
memory_test.go defines 26 function(s): Benchmark_Memory_Get, Benchmark_Memory_Get_Asserted, Benchmark_Memory_Get_Asserted_Parallel, Benchmark_Memory_Get_Parallel, Benchmark_Memory_Set, Benchmark_Memory_SetAndDelete, Benchmark_Memory_SetAndDelete_Asserted, Benchmark_Memory_SetAndDelete_Asserted_Parallel, Benchmark_Memory_SetAndDelete_Parallel, Benchmark_Memory_Set_Asserted, and 16 more.
What does memory_test.go depend on?
memory_test.go imports 1 module(s): context.
Where is memory_test.go in the architecture?
memory_test.go is located at internal/storage/memory/memory_test.go (domain: InternalStorage, subdomain: MemoryStore, directory: internal/storage/memory).

Analyze Your Own Codebase

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

Try Supermodel Free