From: Simon Ruderich Date: Mon, 1 Jul 2013 01:20:38 +0000 (+0200) Subject: tests: Handle `sed` which append a trailing newline. X-Git-Tag: 0.1~13 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=abd557a42fc13b30b63523e8c148c0e5db13ebc2;p=coloredstderr%2Fcoloredstderr.git tests: Handle `sed` which append a trailing newline. --- diff --git a/tests/example.expected b/tests/example.expected index 7a8277a..51e7f39 100644 --- a/tests/example.expected +++ b/tests/example.expected @@ -7,3 +7,4 @@ write to stderr 2STDERR> stderr ... STDERR>xSTDERR>example_err: warning: message: Cannot allocate memory example_err: warning: message PROGfile:42: PROG: Cannot allocate memory PROGfile:42: : Cannot allocate memory -STDERR>another redirect to stderr -STDERR>write to stderr -STDERR>write to stderr without newlineSTDERR>write to stderr without newlineSTDERR>fputs_unlocked()STDERR>xSTDERR>ySTDERR>Before vfork(). After vfork(). "$output" 2>&1 ) + # Some sed implementations (e.g. on FreeBSD 9.1) always append a trailing + # newline. Add "EOF" to detect if the real output had one. + echo EOF >> "$output" + # Merge continuous regions of colored output. The exact calls don't matter # as long as the output is colored. sed 's/STDERR>//g' < "$output" > "$output.tmp"