Fix newlines in TAP stdout/stderr output

It turns out, newlines are not "printable", causing the TAP
stderr/stdout output to be smushed. Also address etune's comment on
pr3208.
This commit is contained in:
Zach Loafman 2015-01-06 08:08:19 -08:00
parent cae572290b
commit 9312af4f79

View File

@ -499,10 +499,12 @@ func printBashOutputs(headerprefix, lineprefix, stdout, stderr string, escape bo
func escapeOutput(s string) (out string) {
for _, r := range s {
switch {
case r == '\n':
out += string(r)
case !strconv.IsPrint(r):
out += " "
case r == ':':
out += "\u02D0" // "ː", MODIFIER LETTER TRIANGULAR COLON
out += "\ua789" // "", modifier letter colon
default:
out += string(r)
}