47
type errorWriter struct{}
49
func (e errorWriter) Write(b []byte) (int, error) {
50
return 0, errors.New("Test")
53
func TestError(t *testing.T) {
56
f.Write([]string{"abc"})
61
t.Errorf("Unexpected error: %s\n", err)
64
f = NewWriter(errorWriter{})
65
f.Write([]string{"abc"})
70
t.Error("Error should not be nil")