(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func 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 | |
| 31 | func TestFetchFile(t *testing.T) { |
| 32 | d := map[string][]byte{ |
nothing calls this directly
no test coverage detected