From: Ralph Corderoy Date: Sun, 16 Oct 2016 14:50:12 +0000 (+0100) Subject: Expand the test of scan's -forma; fails on first attempt. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/6d986a2aeb2600ae7e576975a2f80f01d6d5dbf4?ds=inline;hp=cfb5a32c4e47d9061ced49e74f34c275bd9e4b54 Expand the test of scan's -forma; fails on first attempt. For an email that's just `a:\nb:\nc:\n', a scan with `%{a}\n%{b}\n%{c}' is one blank line short. If the `%{c}' has anything added then its line prints. Break out of the loop so all the other tests are skipped. --- diff --git a/test/scan/test-header-parsing b/test/scan/test-header-parsing index 093d6772..29a625e6 100755 --- a/test/scan/test-header-parsing +++ b/test/scan/test-header-parsing @@ -15,16 +15,18 @@ mail="$MH_TEST_DIR/$$.mail" expected="$MH_TEST_DIR/$$.expected" actual="$MH_TEST_DIR/$$.actual" -cat >"$mail" <<\E -a:b -cd:ef -ghi:jkl -mnop:rstu -E -sed 's/.*://' "$mail" >"$expected" -f="`sed 's/:.*/}/; s/^/%{/' "$mail"`" -run_prog scan -forma "$f" -file "$mail" >"$actual" || -exit 1 -check "$expected" "$actual" +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 + 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" || + exit 1 + check "$expected" "$actual" expectfail + break 3 # Fails on first iteration! + done + done +done exit $failed