(t *testing.T)
| 78 | if !d.read { |
| 79 | d.read = true |
| 80 | return d.entries, nil |
| 81 | } |
| 82 | return nil, d.err |
| 83 | } |
| 84 | |
| 85 | func (d *scriptedCacheDirectory) Close() error { return nil } |
| 86 | |
| 87 | func TestIsValidCacheKey(t *testing.T) { |
| 88 | cases := []struct { |
| 89 | key string |
| 90 | want bool |
| 91 | }{ |
| 92 | {strings.Repeat("a", 64), true}, |
| 93 | {strings.Repeat("f", 64), true}, |
| 94 | {"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", true}, |
| 95 | // Wrong length. |
| 96 | {strings.Repeat("a", 63), false}, |
nothing calls this directly
no test coverage detected