From abd557a42fc13b30b63523e8c148c0e5db13ebc2 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 1 Jul 2013 03:20:38 +0200 Subject: [PATCH] tests: Handle `sed` which append a trailing newline. --- tests/example.expected | 1 + tests/example_environment_empty.expected | 1 + tests/example_err.expected | 1 + tests/example_error.expected | 2 +- tests/example_exec.expected | 1 + tests/example_noforce.sh.expected | 2 +- tests/example_redirects.sh.expected | 2 +- tests/example_simple.sh.expected | 2 +- tests/example_stdio.expected | 1 + tests/example_vfork.expected | 1 + tests/lib.sh | 4 ++++ 11 files changed, 14 insertions(+), 4 deletions(-) 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" -- 2.43.2