2 ######################################################
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
9 ######################################################
11 if test -z "${MH_OBJ_DIR}"; then
12 srcdir=`dirname "$0"`/../..
13 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
16 . "$MH_OBJ_DIR/test/common.sh"
20 # create test replgroupcomps
21 form=$MH_TEST_DIR/$$.replgroupcomps
23 X-STRING: %(num)%(lit)%<(lit FOO) found%| missing%>\n\
24 X-NUMBER: %(num)%(lit)%<(num 3) yes%| no%>\n\
25 X-NOSTRING: %(num 3)%(lit x)%<(lit) found%| missing%>\n\
26 X-NONUMBER: %(num 3)%(lit x)%<(num) yes%| no%>\n\
30 expected=$MH_TEST_DIR/$$.expected
31 actual=$MH_TEST_DIR/Mail/draft
36 X-NOSTRING: 3x missing
40 > This is message number 1
43 repl -editor true -format -form $form -group -nocc me -nowhatnowproc 1 || exit 1
45 check "$expected" "$actual"
47 test ${failed:-0} -eq 0 && rm "$form"