]> diplodocus.org Git - nmh/commitdiff
Fix test-header-parsing test script.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sat, 29 Oct 2016 23:03:34 +0000 (00:03 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 30 Oct 2016 15:17:27 +0000 (15:17 +0000)
It was using sh's backticks that chomped the last linefeed!
Add comment referencing the commit that fixed the code this is testing.
Have fewer test cases, sticking to just one or two character headers
with empty or one-character bodies.  Avoids slowing the tests too much
and the fixed bug was to do with hashing one-character headers.

Makefile.am
test/scan/test-header-parsing

index 978e572..8aecc8b 100644 (file)
@@ -113,7 +113,6 @@ TESTS = test/ali/test-ali test/anno/test-anno \
        test/cleanup ## The "cleanup" test should always be last.
 
 XFAIL_TESTS = \
        test/cleanup ## The "cleanup" test should always be last.
 
 XFAIL_TESTS = \
-    test/scan/test-header-parsing \
     #
 
 check_SCRIPTS = test/common.sh
     #
 
 check_SCRIPTS = test/common.sh
index 37b3b04..48da05e 100755 (executable)
@@ -1,5 +1,9 @@
 #!/bin/sh
 
 #!/bin/sh
 
+# Test short headers and short bodies.
+# One-character long headers used to sometimes be missed;  see commit
+# 41a82a7ecba04be5b27b3ffc813e2f34d2786a38.
+
 set -e
 
 if test -z "${MH_OBJ_DIR}"; then
 set -e
 
 if test -z "${MH_OBJ_DIR}"; then
@@ -14,17 +18,17 @@ setup_test
 mail="$MH_TEST_DIR/$$.mail"
 expected="$MH_TEST_DIR/$$.expected"
 actual="$MH_TEST_DIR/$$.actual"
 mail="$MH_TEST_DIR/$$.mail"
 expected="$MH_TEST_DIR/$$.expected"
 actual="$MH_TEST_DIR/$$.actual"
+format="$MH_TEST_DIR/$$.format"
 
 
-for a in a: a:1 a:12 aa: aa:1 aa:12 aaa: aaa:1 aaa:12 aaaa: aaaa:1 aaaa:12; do
-    for b in b: b:1 b:12 bb: bb:1 bb:12 bbb: bbb:1 bbb:12 bbbb: bbbb:1 bbbb:12; do
-        for c in c: c:1 c:12 cc: cc:1 cc:12 ccc: ccc:1 ccc:12 cccc: cccc:1 cccc:12; do
+for a in a: a:1 aa: aa:1; do
+    for b in b: b:1 bb: bb:1; do
+        for c in c: c:1 cc: cc:1; do
             printf '%s\n%s\n%s\n' $a $b $c >"$mail"
             sed 's/.*://' "$mail" >"$expected"
             printf '%s\n%s\n%s\n' $a $b $c >"$mail"
             sed 's/.*://' "$mail" >"$expected"
-            f="`sed 's/:.*/}/; s/^/%{/' "$mail"`"
-            run_prog scan -forma "$f" -file "$mail" >"$actual" ||
+            sed 's/:.*/}/; s/^/%{/' "$mail" >"$format"
+            run_prog scan -form "$format" -file "$mail" >"$actual" ||
             exit 1
             check "$expected" "$actual"
             exit 1
             check "$expected" "$actual"
-            break 3 # Fails on first iteration!
         done
     done
 done
         done
     done
 done