From: Ralph Corderoy Date: Wed, 17 May 2017 11:58:15 +0000 (+0100) Subject: test/mhbuild/test-cte: Move run_prog() to just before check(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/f8eb50d26b0377b026913d5c44705c82e48c6fdc?ds=sidebyside test/mhbuild/test-cte: Move run_prog() to just before check(). Prepare the input and output files, then run the program and check the result. Makes it easier to see every run is being checked if a, sometimes large, expected-output file isn't being produced in between. --- diff --git a/test/mhbuild/test-cte b/test/mhbuild/test-cte index bbebb028..4312c11e 100755 --- a/test/mhbuild/test-cte +++ b/test/mhbuild/test-cte @@ -35,8 +35,6 @@ Fcc: +outbox This is a test of a message with a shørt line. EOF -run_prog mhbuild "$draft" - cat > "$expected" < cc: @@ -48,6 +46,7 @@ Content-Transfer-Encoding: quoted-printable This is a test of a message with a sh=C3=B8rt line. EOF +run_prog mhbuild "$draft" check "$draft" "$expected" # @@ -66,8 +65,6 @@ Fcc: +outbox This is a test of a message with a shørt line. EOF -run_prog mhbuild "$draft" - cat > "$expected" < cc: @@ -79,6 +76,7 @@ Content-Transfer-Encoding: base64 VGhpcyBpcyBhIHRlc3Qgb2YgYSBtZXNzYWdlIHdpdGggYSBzaMO4cnQgbGluZS4NCg== EOF +run_prog mhbuild "$draft" check "$draft" "$expected" cat > "$draft" < "$expected" < cc: @@ -103,6 +99,7 @@ Content-Transfer-Encoding: base64 VGhpcyBpcyBhIHRlc3Qgb2YgYSBtw6tzc2FnZSB3aXRoIGEgc2jDuHJ0IGxpbmUuDQo= EOF +run_prog mhbuild "$draft" check "$draft" "$expected" cat > "$draft" < "$expected" < cc: @@ -127,6 +122,7 @@ Content-Transfer-Encoding: base64 VGhpcyBpcyBhIHRlc3Qgb2YgYSBtw6tzc8OkZ2Ugd2l0aCBhIHNow7hydCBsaW5lLg0K EOF +run_prog mhbuild "$draft" check "$draft" "$expected" cat > "$draft" < "$expected" < cc: @@ -153,6 +147,7 @@ VGhpcyBpcyBhIHRlc3Qgb2YgYSBtZXNzYWdlIHdpdGggYSBzaMO4cnQgbGluZS4NClRoaXMgaXMg YSBzZWNvbmQgbGluZS4NCg== EOF +run_prog mhbuild "$draft" check "$draft" "$expected" cat > "$draft" < "$expected" < cc: @@ -179,6 +172,7 @@ VGhpcyBpcyBhIHRlc3Qgb2YgYSBtw6tzc2FnZSB3aXRoIGEgc2jDuHJ0IGxpbmUuDQpUaGlzIGlz IGEgc2Vjb25kIGxpbmUuDQo= EOF +run_prog mhbuild "$draft" check "$draft" "$expected" cat > "$draft" < "$expected" < cc: @@ -205,6 +197,7 @@ VGhpcyBpcyBhIHRlc3Qgb2YgYSBtw6tzc8OkZ2Ugd2l0aCBhIHNow7hydCBsaW5lLg0KVGhpcyBp cyBhIHNlY29uZCBsaW5lLg0K EOF +run_prog mhbuild "$draft" check "$draft" "$expected" cat > "$draft" < "$expected" < cc: @@ -237,6 +228,7 @@ VGhpcyBpcyBhIHRlc3Qgb2YgYSBtw6tzc8OkZ2Ugd2l0aCBhIHNow7hydCBsaW5lLg0KDQoNClRo aXMgaXMgYSBzZWNvbmQgbGluZS4NCg0KDQoNCg0K EOF +run_prog mhbuild "$draft" check "$draft" "$expected" # @@ -255,8 +247,6 @@ This is a test of a messege with a long line. This line needs to be longer than This is a second line. EOF -run_prog mhbuild "$draft" - cat > "$expected" < cc: @@ -288,6 +278,7 @@ the airs from that infernal nonsense Pinafore. = This is a second line. EOF +run_prog mhbuild "$draft" check "$draft" "$expected" cat > "$draft" < "$expected" < cc: @@ -333,6 +322,7 @@ the airs from that infernal nonsense Pinafore. = This is a sec=C3=B6nd line. EOF +run_prog mhbuild "$draft" check "$draft" "$expected" cat > "$draft" < "$expected" < cc: @@ -375,6 +363,7 @@ Content-Transfer-Encoding: 8bit This is the test of a lønger line than the usual limit. Assuming we set the maxunencded parameter properly, this should end up as 8bit? EOF +run_prog mhbuild -maxunencoded 200 "$draft" check "$draft" "$expected" [ ${failed:=0} -eq 0 ] && rm -f ${backup}