(ctx context.Context, t *testing.T, fs afero.Fs, fileFullPath string, cache *FileCache, key, wantValue string)
| 41 | } |
| 42 | |
| 43 | func 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 | } |