MCPcopy Create free account
hub / github.com/Azure/peerd / TestFileChunkKey

Function TestFileChunkKey

pkg/files/files_test.go:15–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestFileChunkKey(t *testing.T) {
16 d := "abc"
17 cacheBlockSize := int64(1024)
18
19 key := FileChunkKey(d, 123, cacheBlockSize)
20 if key != "abc_0" {
21 t.Errorf("expected key %s, got %s", "abc_0", key)
22 }
23
24 key = FileChunkKey(d, int64(123)+cacheBlockSize, cacheBlockSize)
25 exp := fmt.Sprintf("abc_%v", cacheBlockSize)
26 if key != exp {
27 t.Errorf("expected key %s, got %s", exp, key)
28 }
29}
30
31func TestFetchFile(t *testing.T) {
32 d := map[string][]byte{

Callers

nothing calls this directly

Calls 1

FileChunkKeyFunction · 0.85

Tested by

no test coverage detected