]> diplodocus.org Git - nmh/blobdiff - test/slocal/test-slocal
sbr/oauth.c: Remove const to avoid curl's debug_callback warning.
[nmh] / test / slocal / test-slocal
index cadda35360a99455b509b6acd34acd47bc06ecbd..1213117b00fc39e2dfdeb910cf77cc4ca0650e14 100755 (executable)
@@ -17,7 +17,9 @@ fi
 setup_test
 
 # Use proper program, maybe not the first one on PATH.
-slocal="$MH_LIB_DIR"/slocal
+slocal="$MH_LIBEXEC_DIR"/slocal
+
+check_exit '-eq 1' $slocal -
 
 expected="$MH_TEST_DIR"/$$.expected
 actual="$MH_TEST_DIR"/$$.actual
@@ -42,7 +44,8 @@ Usage: slocal [switches]
   -help
 EOF
 
-run_prog $slocal -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog $slocal -help | sed '/^$/,$d' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
@@ -143,19 +146,23 @@ run_prog $slocal -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/5
 check "$MH_TEST_DIR/Mail/inbox/5" "$actual" 'keep first'
 check "$MH_TEST_DIR/Mail/inbox/5" "$actual2" 'keep first'
 
-# Use current login for address, user, etc., because it must be an
-# existing user on the host.
-me=`"$MH_LIB_DIR"/ap -format '%(me)' 0`
-
 # check -addr
 cat >"$md"  <<EOF
-addr "$me" qpipe A "$tee $actual"
+addr someaddress qpipe A "$tee $actual"
 EOF
 
-run_prog $slocal -addr "$me" -maildelivery "$md" $mbox \
+run_prog $slocal -addr someaddress -maildelivery "$md" $mbox \
   <"$MH_TEST_DIR"/Mail/inbox/6
 check "$MH_TEST_DIR/Mail/inbox/6" "$actual" 'keep first'
 
+# check -addr with . in address
+cat >"$md"  <<EOF
+addr "first.last" qpipe A "$tee $actual"
+EOF
+run_prog $slocal -addr 'first.last' \
+  -maildelivery "$md" $mbox <"$MH_TEST_DIR"/Mail/inbox/6
+check "$MH_TEST_DIR/Mail/inbox/6" "$actual" 'keep first'
+
 # check -info
 cat >"$md"  <<EOF
 * - qpipe A "\$(info) $actual"
@@ -167,10 +174,10 @@ check "$MH_TEST_DIR/Mail/inbox/7" "$actual" 'keep first'
 
 # check -sender, which is compared with "source"
 cat >"$md"  <<EOF
-source "$me" qpipe A "$tee $actual"
+source somesender qpipe A "$tee $actual"
 EOF
 
-run_prog $slocal -sender "$me" -maildelivery "$md" $mbox \
+run_prog $slocal -sender somesender -maildelivery "$md" $mbox \
   <"$MH_TEST_DIR"/Mail/inbox/8
 check "$MH_TEST_DIR/Mail/inbox/8" "$actual" 'keep first'
 
@@ -179,10 +186,16 @@ cat >"$md"  <<EOF
 * - qpipe A "$tee $actual"
 EOF
 
+# Use current login for user because it must be an existing user on the host.
+me=`"$MH_LIBEXEC_DIR"/ap -format '%(me)' 0`
 run_prog $slocal -user "$me" -maildelivery "$md" $mbox \
   <"$MH_TEST_DIR"/Mail/inbox/9
 check "$MH_TEST_DIR/Mail/inbox/9" "$actual" 'keep first'
 
+# Can't check -user with . in address because the user must
+# have an account on the local system, and we can't guarantee
+# that there is one.
+
 # check -mailbox
 cat >"$md"  <<EOF
 EOF
@@ -221,5 +234,4 @@ run_prog $slocal -suppress -nosuppressdup -maildelivery "$md" $mbox \
   <"$MH_TEST_DIR"/Mail/inbox/2
 check "$MH_TEST_DIR/Mail/inbox/2" "$actual" 'keep first'
 
-
 exit ${failed:-0}