#!/bin/sh ###################################################### # # Test that an '%<(function)...' if-construct correctly # tests whether 'str' is empty if the function returns # a string, and tests 'value' if the function returns # an integer. # ###################################################### if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test # create test replgroupcomps form=$MH_TEST_DIR/$$.replgroupcomps cat > $form <\n\ X-NUMBER: %(num)%(lit)%<(num 3) yes%| no%>\n\ X-NOSTRING: %(num 3)%(lit x)%<(lit) found%| missing%>\n\ X-NONUMBER: %(num 3)%(lit x)%<(num) yes%| no%>\n\ -------- EOF expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/Mail/draft cat > $expected < This is message number 1 EOF repl -editor true -format -form $form -group -nocc me -nowhatnowproc 1 || exit 1 check "$expected" "$actual" test ${failed:-0} -eq 0 && rm "$form" exit $failed