#!/bin/sh ###################################################### # # Basic mhbuild tests. # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test expected="$MH_TEST_DIR/test-mhbuild$$.expected" start_test "-nodirectives" cat >"$expected" <<'EOF' Subject: test -nodirectives MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" #define line begins with # and ends with backslash-newline \ all characters should be preserved EOF cat >"`mhpath new`" <<'EOF' Subject: test -nodirectives -------- #define line begins with # and ends with backslash-newline \ all characters should be preserved EOF run_test "mhbuild -nodirectives `mhpath last`" check "`mhpath last`" "$expected" start_test "Checking for MIME-Version handling in draft" cat > "`mhpath new`" <<'EOF' From: Somebody To: Nobody Subject: Test message MIME-Version: 1.0 -------- This is a test EOF cat >"$expected" <<'EOF' From: Somebody To: Nobody Subject: Test message MIME-Version: 1.0 -------- This is a test EOF run_test "mhbuild `mhpath last`" "mhbuild: draft shouldn't contain MIME-Version: field" check "`mhpath last`" "$expected" 'keep first' cat >"$expected" <<'EOF' From: Somebody To: Nobody Subject: Test message MIME-Version: 1.0 -------- This is a test EOF run_test "mhbuild -auto `mhpath last`" check "`mhpath last`" "$expected" start_test "Checking for arbitrary Content header handling in draft" cat > "`mhpath new`" <<'EOF' From: Somebody To: Nobody Subject: Test message Content-Fart: nothing -------- This is a test EOF cat >"$expected" <<'EOF' From: Somebody To: Nobody Subject: Test message Content-Fart: nothing -------- This is a test EOF run_test "mhbuild `mhpath last`" "mhbuild: draft shouldn't contain Content-Fart: field" check "`mhpath last`" "$expected" 'keep first' cat >"$expected" <<'EOF' From: Somebody To: Nobody Subject: Test message Content-Fart: nothing -------- This is a test EOF run_test "mhbuild -auto `mhpath last`" "mhbuild: draft shouldn't contain Content-Fart: field" check "`mhpath last`" "$expected" start_test "Checking for out-of-order Content header handling in draft" cat > "`mhpath new`" <<'EOF' From: Somebody To: Nobody Subject: Test message Content-Fart: nothing MIME-Version: 1.0 -------- This is a test EOF cat >"$expected" <<'EOF' From: Somebody To: Nobody Subject: Test message Content-Fart: nothing MIME-Version: 1.0 -------- This is a test EOF run_test "mhbuild `mhpath last`" "mhbuild: draft shouldn't contain MIME-Version: field" check "`mhpath last`" "$expected" 'keep first' cat >"$expected" <<'EOF' From: Somebody To: Nobody Subject: Test message Content-Fart: nothing MIME-Version: 1.0 -------- This is a test EOF run_test "mhbuild -auto `mhpath last`" check "`mhpath last`" "$expected" finish_test exit $failed