mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
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:
parent
cae572290b
commit
9312af4f79
@ -499,10 +499,12 @@ func printBashOutputs(headerprefix, lineprefix, stdout, stderr string, escape bo
|
|||||||
func escapeOutput(s string) (out string) {
|
func escapeOutput(s string) (out string) {
|
||||||
for _, r := range s {
|
for _, r := range s {
|
||||||
switch {
|
switch {
|
||||||
|
case r == '\n':
|
||||||
|
out += string(r)
|
||||||
case !strconv.IsPrint(r):
|
case !strconv.IsPrint(r):
|
||||||
out += " "
|
out += " "
|
||||||
case r == ':':
|
case r == ':':
|
||||||
out += "\u02D0" // "ː", MODIFIER LETTER TRIANGULAR COLON
|
out += "\ua789" // "꞉", modifier letter colon
|
||||||
default:
|
default:
|
||||||
out += string(r)
|
out += string(r)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user