X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=test%2Ftests%2Frepl%2Ftest-if-str;fp=test%2Ftests%2Frepl%2Ftest-if-str;h=7582a7d35f6c1d27928043509dcf63b184e5ff9f;hb=4f653e8f897068fc803607a5975fa18ab1519bcf;hp=0000000000000000000000000000000000000000;hpb=a107dc40d92e7a37be148816db160325326318e3;p=mmh diff --git a/test/tests/repl/test-if-str b/test/tests/repl/test-if-str new file mode 100644 index 0000000..7582a7d --- /dev/null +++ b/test/tests/repl/test-if-str @@ -0,0 +1,36 @@ +#!/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. +# +###################################################### + +# 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 + +diff -u $expected $actual