]> diplodocus.org Git - nmh/blobdiff - test/format/test-fmtdump
Document the -port flag. Text copied from inc.man .
[nmh] / test / format / test-fmtdump
index 0e723dce0d17d873442b77429e9387cbd030d7e9..6cbdfe4f0e81172f630f15f1460e562aaf42fed4 100755 (executable)
@@ -49,6 +49,7 @@ actual_err=$MH_TEST_DIR/$$.actual_err
 
 
 # check -help
+start_test "-help"
 cat >$expected <<EOF
 Usage: fmtdump [switches]
   switches are:
@@ -63,6 +64,7 @@ EOF
 check "$expected" "$actual"
 
 # check -version
+start_test "-version"
 case `$fmtdump -v` in
   fmtdump\ --*) ;;
   *           ) printf '%s: fmtdump -v generated unexpected output\n' "$0" >&2
@@ -70,9 +72,11 @@ case `$fmtdump -v` in
 esac
 
 # check unknown switch
+start_test "unknown switch"
 run_test "$fmtdump -nonexistent" 'fmtdump: -nonexistent unknown'
 
 # check with no switches
+start_test "with no switches"
 cat >$expected <<EOF
        LV_DAT, value dat[0]
        NUMF, width 4, fill ' '
@@ -85,12 +89,8 @@ L1:  LS_COMP, comp "replied"
        IF_S continue else goto L2
        CHAR '-'
        GOTO L3
-L2:    LS_COMP, comp "encrypted"
-       IF_S continue else goto L4
-       CHAR 'E'
-L3:    GOTO L5
-L4:    CHAR ' '
-L5:    PARSEDATE, c_name "date", c_type <DATE>
+L2:    CHAR ' '
+L3:    PARSEDATE, c_name "date", c_type <DATE>
        LV_MON, c_name "date", c_type <DATE>
        NUMF, width 2, fill '0'
        CHAR '/'
@@ -98,35 +98,35 @@ L5: PARSEDATE, c_name "date", c_type <DATE>
        LV_MDAY, c_name "date", c_type <DATE>
        NUMF, width 2, fill '0'
        LS_COMP, comp "date", c_type <DATE>
-       IF_S continue else goto L6
+       IF_S continue else goto L4
        CHAR ' '
-       GOTO L7
-L6:    CHAR '*'
-L7:    MYMBOX, c_name "from", c_type <ADDR>
+       GOTO L5
+L4:    CHAR '*'
+L5:    MYMBOX, c_name "from", c_type <ADDR>
        LV_COMPFLAG, comp "from", c_type <ADDR>
-       IF_V_NE 0 continue else goto L8
+       IF_V_NE 0 continue else goto L6
        LS_COMP, comp "to", c_type <ADDR>
-       IF_S continue else goto L8
+       IF_S continue else goto L6
        LIT "To:"
        PARSEADDR, c_name "to", c_type <ADDR>
        LS_FRIENDLY, c_name "to", c_type <ADDR>
        LS_DECODE
        STRF, width 14, fill ' '
-L8:    IF_V_EQ 0 continue else goto L9
+L6:    IF_V_EQ 0 continue else goto L7
        PARSEADDR, c_name "from", c_type <ADDR>
        LS_FRIENDLY, c_name "from", c_type <ADDR>
        LS_DECODE
        STRF, width 17, fill ' '
-L9:    LIT "  "
+L7:    LIT "  "
        LS_COMP, comp "subject"
        LS_DECODE
        STR
        LS_COMP, comp "body"
-       IF_S continue else goto L10
+       IF_S continue else goto L8
        LIT "<<"
        COMP, comp "body"
        LIT ">>"
-L10:   CHAR '\n'
+L8:    CHAR '\n'
        DONE
 EOF
 
@@ -134,6 +134,7 @@ run_prog $fmtdump >$actual 2>&1
 check $expected $actual
 
 # check -form
+start_test "-form"
 cat >$expected <<EOF
        LV_DAT, value dat[0]
        NUMF, width 4, fill ' '
@@ -146,12 +147,8 @@ L1:        LS_COMP, comp "replied"
        IF_S continue else goto L2
        CHAR '-'
        GOTO L3
-L2:    LS_COMP, comp "encrypted"
-       IF_S continue else goto L4
-       CHAR 'E'
-L3:    GOTO L5
-L4:    CHAR ' '
-L5:    PARSEDATE, c_name "date", c_type <DATE>
+L2:    CHAR ' '
+L3:    PARSEDATE, c_name "date", c_type <DATE>
        LV_MON, c_name "date", c_type <DATE>
        NUMF, width 2, fill '0'
        CHAR '/'
@@ -159,37 +156,37 @@ L5:       PARSEDATE, c_name "date", c_type <DATE>
        LV_MDAY, c_name "date", c_type <DATE>
        NUMF, width 2, fill '0'
        LS_COMP, comp "date", c_type <DATE>
-       IF_S continue else goto L6
+       IF_S continue else goto L4
        CHAR ' '
-       GOTO L7
-L6:    CHAR '*'
-L7:    MYMBOX, c_name "from", c_type <ADDR>
+       GOTO L5
+L4:    CHAR '*'
+L5:    MYMBOX, c_name "from", c_type <ADDR>
        LV_COMPFLAG, comp "from", c_type <ADDR>
-       IF_V_NE 0 continue else goto L8
+       IF_V_NE 0 continue else goto L6
        LS_COMP, comp "to", c_type <ADDR>
-       IF_S continue else goto L8
+       IF_S continue else goto L6
        LIT "To:"
        PARSEADDR, c_name "to", c_type <ADDR>
        LS_FRIENDLY, c_name "to", c_type <ADDR>
        LS_DECODE
        LS_UNQUOTE
        STRF, width 14, fill ' '
-L8:    IF_V_EQ 0 continue else goto L9
+L6:    IF_V_EQ 0 continue else goto L7
        PARSEADDR, c_name "from", c_type <ADDR>
        LS_FRIENDLY, c_name "from", c_type <ADDR>
        LS_DECODE
        LS_UNQUOTE
        STRF, width 17, fill ' '
-L9:    LIT "  "
+L7:    LIT "  "
        LS_COMP, comp "subject"
        LS_DECODE
        STR
        LS_COMP, comp "body"
-       IF_S continue else goto L10
+       IF_S continue else goto L8
        LIT "<<"
        COMP, comp "body"
        LIT ">>"
-L10:   CHAR '\n'
+L8:    CHAR '\n'
        DONE
 EOF
 
@@ -197,6 +194,7 @@ run_prog $fmtdump -form "$MH_INST_DIR${nmhetcdir}/scan.default" >$actual 2>&1
 check $expected $actual
 
 # check -format
+start_test "-format"
 cat >$expected <<EOF
        LS_LIT str "1234567890"
        IF_S continue else goto L0
@@ -209,4 +207,5 @@ run_prog $fmtdump -format '%<(lit 1234567890)%(strlen)%>' >$actual 2>&1
 check $expected $actual
 
 
+finish_test
 exit ${failed:-0}