MCPcopy Index your code
hub / github.com/filebrowser/filebrowser / checkValue

Function checkValue

diskcache/file_cache_test.go:43–55  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, fs afero.Fs, fileFullPath string, cache *FileCache, key, wantValue string)

Source from the content-addressed store, hash-verified

41}
42
43func checkValue(ctx context.Context, t *testing.T, fs afero.Fs, fileFullPath string, cache *FileCache, key, wantValue string) {
44 t.Helper()
45 // check actual file content
46 b, err := afero.ReadFile(fs, fileFullPath)
47 require.NoError(t, err)
48 require.Equal(t, wantValue, string(b))
49
50 // check cache content
51 b, ok, err := cache.Load(ctx, key)
52 require.NoError(t, err)
53 require.True(t, ok)
54 require.Equal(t, wantValue, string(b))
55}

Callers 1

TestFileCacheFunction · 0.85

Calls 1

LoadMethod · 0.65

Tested by

no test coverage detected