(t *testing.T)
| 33 | } |
| 34 | |
| 35 | func Test_readTextFileFirstLineNotUTF8(t *testing.T) { |
| 36 | scanner, _, err := ReadTextFile(bytes.NewReader([]byte{0xFF, 0xFF}), nil) |
| 37 | |
| 38 | // method itself doesn't return an error, only the scanning fails for utf8. |
| 39 | assert.NotNil(t, scanner) |
| 40 | assert.NoError(t, err) |
| 41 | |
| 42 | ok := scanner.Scan() |
| 43 | assert.False(t, ok) |
| 44 | assert.ErrorIs(t, scanner.Err(), ErrBinaryFile) |
| 45 | } |
| 46 | |
| 47 | func Test_readTextFileNoLineEnding(t *testing.T) { |
| 48 | scanner, le, err := ReadTextFile(bytes.NewReader([]byte("abc")), nil) |
nothing calls this directly
no test coverage detected
searching dependent graphs…