]> diplodocus.org Git - nmh/blobdiff - test/folder/test-sortm
Replace `(char *)0' et al with `NULL'.
[nmh] / test / folder / test-sortm
index ac0f8421fe9e1bb27b5705809362c231597318de..e6c73bae45df80fad6066ca915b860f0517c04dd 100755 (executable)
@@ -37,7 +37,8 @@ Usage: sortm [+folder] [msgs] [switches]
   -help
 EOF
 
   -help
 EOF
 
-run_prog sortm -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog sortm -help | sed '/^$/,$d' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
 check "$expected" "$actual"
 
 # check -version
@@ -84,7 +85,7 @@ cat >"$expected" <<EOF
 EOF
 
 run_prog sortm
 EOF
 
 run_prog sortm
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check +folder
 check "$expected" "$actual"
 
 # check +folder
@@ -105,7 +106,7 @@ EOF
 
 refile first +inbox; folder -pack >/dev/null
 run_prog sortm +inbox
 
 refile first +inbox; folder -pack >/dev/null
 run_prog sortm +inbox
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -verbose
 check "$expected" "$actual"
 
 # check -verbose
@@ -139,7 +140,7 @@ EOF
 
 refile first +inbox; folder -pack >/dev/null
 run_prog sortm -verbose >"$actual"
 
 refile first +inbox; folder -pack >/dev/null
 run_prog sortm -verbose >"$actual"
-scan >>"$actual"
+scan -width 80 >>"$actual"
 check "$expected" "$actual"
 
 # check -noverbose
 check "$expected" "$actual"
 
 # check -noverbose
@@ -160,7 +161,7 @@ EOF
 
 refile first +inbox; folder -pack >/dev/null
 run_prog sortm -verbose -noverbose >"$actual"
 
 refile first +inbox; folder -pack >/dev/null
 run_prog sortm -verbose -noverbose >"$actual"
-scan >>"$actual"
+scan -width 80 >>"$actual"
 check "$expected" "$actual"
 
 # check msgs
 check "$expected" "$actual"
 
 # check msgs
@@ -181,7 +182,7 @@ EOF
 
 refile first +inbox; folder -pack >/dev/null
 run_prog sortm first last
 
 refile first +inbox; folder -pack >/dev/null
 run_prog sortm first last
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -datefield
 check "$expected" "$actual"
 
 # check -datefield
@@ -201,7 +202,7 @@ cat >"$expected" <<EOF
 EOF
 
 run_prog sortm -datefield Alt-Date 1 11
 EOF
 
 run_prog sortm -datefield Alt-Date 1 11
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -textfield subject (datefield major, subjects grouped)
 check "$expected" "$actual"
 
 # check -textfield subject (datefield major, subjects grouped)
@@ -221,7 +222,7 @@ cat >"$expected" <<EOF
 EOF
 
 run_prog sortm -textfield subject
 EOF
 
 run_prog sortm -textfield subject
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -nolimit
 check "$expected" "$actual"
 
 # check -nolimit
@@ -241,7 +242,7 @@ cat >"$expected" <<EOF
 EOF
 
 run_prog sortm -textfield subject -limit 0 -nolimit
 EOF
 
 run_prog sortm -textfield subject -limit 0 -nolimit
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -textfield subject -limit 0 (subject sort)
 check "$expected" "$actual"
 
 # check -textfield subject -limit 0 (subject sort)
@@ -262,7 +263,7 @@ EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 run_prog sortm -textfield subject -limit 0
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 run_prog sortm -textfield subject -limit 0
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -textfield -limit 0 (text sort)
 check "$expected" "$actual"
 
 # check -textfield -limit 0 (text sort)
@@ -283,7 +284,7 @@ EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 run_prog sortm -textfield from -limit 0
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 run_prog sortm -textfield from -limit 0
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -textfield with finite -limit that doesn't cover message 13
 check "$expected" "$actual"
 
 # check -textfield with finite -limit that doesn't cover message 13
@@ -314,7 +315,7 @@ EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 run_prog sortm -textfield subject -limit 10
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 run_prog sortm -textfield subject -limit 10
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -textfield with finite -limit that does cover message 13
 check "$expected" "$actual"
 
 # check -textfield with finite -limit that does cover message 13
@@ -336,7 +337,7 @@ EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 run_prog sortm -textfield subject -limit 60
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 run_prog sortm -textfield subject -limit 60
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -notextfield
 check "$expected" "$actual"
 
 # check -notextfield
@@ -358,7 +359,7 @@ EOF
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 run_prog sortm -textfield subject -limit 60 -notextfield
 
 refile 2-7 +inbox; refile 1 +inbox; folder -pack last >/dev/null
 run_prog sortm -textfield subject -limit 60 -notextfield
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -noall
 check "$expected" "$actual"
 
 # check -noall
@@ -383,7 +384,7 @@ EOF
 
 refile first +inbox; folder -pack >/dev/null
 run_prog sortm -noall -all
 
 refile first +inbox; folder -pack >/dev/null
 run_prog sortm -noall -all
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -check
 check "$expected" "$actual"
 
 # check -check
@@ -414,7 +415,7 @@ cat >"$expected" <<EOF
   13  10/31 Test13             Re: common subject<<This is message number 13 >>
   14  01/00 Test9              Testing message 9<<This is message number 9 >>
 EOF
   13  10/31 Test13             Re: common subject<<This is message number 13 >>
   14  01/00 Test9              Testing message 9<<This is message number 9 >>
 EOF
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 # check -nocheck
 check "$expected" "$actual"
 
 # check -nocheck
@@ -439,7 +440,7 @@ sed -e 's/Sep//' $MH_TEST_DIR/Mail/inbox/7 > $MH_TEST_DIR/Mail/inbox/14
 run_test 'sortm -check -nocheck' \
          "sortm: can't parse date field in message 14, will use file \
 modification time"
 run_test 'sortm -check -nocheck' \
          "sortm: can't parse date field in message 14, will use file \
 modification time"
-scan >"$actual"
+scan -width 80 >"$actual"
 check "$expected" "$actual"
 
 
 check "$expected" "$actual"