Filtered out "From " lines when comparing mboxes because their
authorDavid Levine <levinedl@acm.org>
Wed, 4 Jul 2012 01:50:23 +0000 (20:50 -0500)
committerDavid Levine <levinedl@acm.org>
Wed, 4 Jul 2012 01:50:23 +0000 (20:50 -0500)
timestamps sometimes differed by a second.

test/rcv/test-rcvpack

index 9433a37..46327b4 100755 (executable)
@@ -19,14 +19,12 @@ setup_test
 # Use proper program, likely not the first one on PATH.
 rcvpack="${MH_LIB_DIR}/rcvpack"
 
-expected=$MH_TEST_DIR/$$.expected
-expected_err=$MH_TEST_DIR/$$.expected_err
-actual=$MH_TEST_DIR/$$.actual
-actual_err=$MH_TEST_DIR/$$.actual_err
+expected="$MH_TEST_DIR/$$.expected"
+actual="$MH_TEST_DIR/$$.actual"
 
 
 # check -help
-cat >$expected <<EOF
+cat >"$expected" <<EOF
 Usage: rcvpack [switches] file
   switches are:
   -mbox
@@ -35,8 +33,8 @@ Usage: rcvpack [switches] file
   -help
 EOF
 
-$rcvpack -help >$actual 2>&1
-check $expected $actual
+$rcvpack -help >"$actual" 2>&1
+check "$expected" "$actual"
 
 # check -version
 case `$rcvpack -v` in
@@ -58,7 +56,10 @@ check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
 
 # check -mbox
 $rcvpack -mmdf -mbox <${MH_TEST_DIR}/Mail/inbox/1 ${MH_TEST_DIR}/Mail/mbox2
-check "${MH_TEST_DIR}/Mail/mbox" "${MH_TEST_DIR}/Mail/mbox2" 'keep first'
+# Filter out "From " lines because their timestamps can differ by a second.
+grep -v '^From ' "${MH_TEST_DIR}/Mail/mbox" >"${MH_TEST_DIR}/Mail/mbox-filt"
+grep -v '^From ' "${MH_TEST_DIR}/Mail/mbox2" >"${MH_TEST_DIR}/Mail/mbox2-filt"
+check "${MH_TEST_DIR}/Mail/mbox-filt" "${MH_TEST_DIR}/Mail/mbox2-filt"
 
 # check append to existing mbox file
 $rcvpack <${MH_TEST_DIR}/Mail/inbox/2 ${MH_TEST_DIR}/Mail/mbox