7d6604b1627cb6cb4db5ff4dec077d83e006a68f
[mmh] / test / tests / repl / test-if-str
1 #!/bin/sh
2 ######################################################
3 #
4 # Test that an '%<(function)...' if-construct correctly
5 # tests whether 'str' is empty if the function returns
6 # a string, and tests 'value' if the function returns
7 # an integer.
8 #
9 ######################################################
10
11 # create test replgroupcomps
12 form=$MH_TEST_DIR/$$.replgroupcomps
13 cat > $form <<EOF
14 X-STRING: %(num)%(lit)%<(lit FOO) found%| missing%>\n\
15 X-NUMBER: %(num)%(lit)%<(num 3) yes%| no%>\n\
16 X-NOSTRING: %(num 3)%(lit x)%<(lit) found%| missing%>\n\
17 X-NONUMBER: %(num 3)%(lit x)%<(num) yes%| no%>\n\
18 --------
19 EOF
20
21 expected=$MH_TEST_DIR/$$.expected
22 actual=$MH_TEST_DIR/Mail/drafts/1
23
24 cat > $expected <<EOF
25 X-STRING: 0 found
26 X-NUMBER: 0 yes
27 X-NOSTRING: 3x missing
28 X-NONUMBER: 3x no
29 --------
30 > This is message number 1
31 EOF
32
33 repl -editor true -form $form -group -nocc me -whatnowproc true 1
34
35 diff -u $expected $actual