(t *testing.T)
| 717 | func (errWriter) Write(p []byte) (n int, err error) { return 0, fmt.Errorf("unwritable") } |
| 718 | |
| 719 | func TestEscapeTextIOErrors(t *testing.T) { |
| 720 | expectErr := "unwritable" |
| 721 | err := EscapeText(errWriter{}, []byte{'A'}) |
| 722 | |
| 723 | if err == nil || err.Error() != expectErr { |
| 724 | t.Errorf("have %v, want %v", err, expectErr) |
| 725 | } |
| 726 | } |
| 727 | |
| 728 | func TestEscapeTextInvalidChar(t *testing.T) { |
| 729 | input := []byte("A \x00 terminated string.") |
nothing calls this directly
no test coverage detected