From 67bb0fc0c930d5c91b6a2881b4596e1044546297 Mon Sep 17 00:00:00 2001 From: David Levine Date: Thu, 18 Jan 2018 19:03:52 -0500 Subject: [PATCH] Filter test output to remove added whitespace. Ralph noticed that lynx added whitespace to the (empty) converted html document, breaking the test. Fix to commit 47629e9e87a324531be881cebfca38dd38f8afaa. --- test/common.sh.in | 6 ++++++ test/mhshow/test-subpart | 3 +-- test/mhshow/test-textcharset | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/common.sh.in b/test/common.sh.in index e8660336..8c054cd6 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -175,6 +175,12 @@ squeeze_lines() { sed '/^$/N;/\n$/D' } +#### Filter that removes blank lines and leading space that lynx inserts. +#### but sufficient for our purpose. +squeeze_whitespace() { + sed '/^$/D; s/^ *//;' +} + #### Filter that converts non-breakable space U+00A0 to an ASCII space. prepare_space() { sed 's/'"`printf '\\302\\240'`"'/ /g' diff --git a/test/mhshow/test-subpart b/test/mhshow/test-subpart index 2a799772..9529e8ee 100755 --- a/test/mhshow/test-subpart +++ b/test/mhshow/test-subpart @@ -136,9 +136,8 @@ EOF # check it start_test 'text/html part' - # The sed command removes blank lines and leading space that lynx inserts. run_prog mhshow -part 1.1.1 -form mhl.null $msgnum | - sed '/^$/D; s/^ *//;' > $actual 2>&1 + squeeze_whitespace > $actual 2>&1 check "$expected" "$actual" : part 1.1.1 fi diff --git a/test/mhshow/test-textcharset b/test/mhshow/test-textcharset index 78500a5d..68d6b347 100755 --- a/test/mhshow/test-textcharset +++ b/test/mhshow/test-textcharset @@ -319,7 +319,7 @@ cat >"$expected" <"$actual" 2>&1 +run_prog mhshow -noheader -form mhl.null last | squeeze_whitespace >"$actual" 2>&1 check "$expected" "$actual" : malicious parameter value quoting # -- 2.56.0