Test test infrastructure first!
(t *testing.T)
| 1052 | |
| 1053 | // Test test infrastructure first! |
| 1054 | func TestRandomSource(t *testing.T) { |
| 1055 | source := newRandomSource(1e8) |
| 1056 | sink := newRandomSource(1e8) |
| 1057 | n, err := io.Copy(sink, source) |
| 1058 | assert.NoError(t, err) |
| 1059 | assert.Equal(t, int64(1e8), n) |
| 1060 | |
| 1061 | source = newRandomSource(1e8) |
| 1062 | buf := make([]byte, 16) |
| 1063 | _, _ = source.Read(buf) |
| 1064 | sink = newRandomSource(1e8) |
| 1065 | _, err = io.Copy(sink, source) |
| 1066 | assert.EqualError(t, err, "Error in stream at 1") |
| 1067 | } |
| 1068 | |
| 1069 | type zeroes struct{} |
| 1070 |
nothing calls this directly
no test coverage detected
searching dependent graphs…