(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestNewDigestingReader(t *testing.T) { |
| 14 | // Only the failure cases, success is tested in TestDigestingReaderRead below. |
| 15 | source := bytes.NewReader([]byte("abc")) |
| 16 | for _, input := range []digest.Digest{ |
| 17 | "abc", // Not algo:hexvalue |
| 18 | "crc32:", // Unknown algorithm, empty value |
| 19 | "crc32:012345678", // Unknown algorithm |
| 20 | "sha256:", // Empty value |
| 21 | "sha256:0", // Invalid hex value |
| 22 | "sha256:01", // Invalid length of hex value |
| 23 | } { |
| 24 | _, err := newDigestingReader(source, input) |
| 25 | assert.Error(t, err, input.String()) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func TestDigestingReaderRead(t *testing.T) { |
| 30 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…