(t *testing.T)
| 110 | } |
| 111 | |
| 112 | func TestDiffIDComputationGoroutine(t *testing.T) { |
| 113 | stream, err := os.Open("fixtures/Hello.uncompressed") |
| 114 | require.NoError(t, err) |
| 115 | res := goDiffIDComputationGoroutineWithTimeout(stream, nil) |
| 116 | require.NotNil(t, res) |
| 117 | assert.NoError(t, res.err) |
| 118 | assert.Equal(t, "sha256:185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969", res.digest.String()) |
| 119 | |
| 120 | // Error reading input |
| 121 | reader, writer := io.Pipe() |
| 122 | err = writer.CloseWithError(errors.New("Expected error reading input in diffIDComputationGoroutine")) |
| 123 | require.NoError(t, err) |
| 124 | res = goDiffIDComputationGoroutineWithTimeout(reader, nil) |
| 125 | require.NotNil(t, res) |
| 126 | assert.Error(t, res.err) |
| 127 | } |
| 128 | |
| 129 | func TestComputeDiffID(t *testing.T) { |
| 130 | for _, c := range []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…