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
12form=$MH_TEST_DIR/$$.replgroupcomps
13cat > $form <<EOF
14X-STRING: %(num)%(lit)%<(lit FOO) found%| missing%>\n\
15X-NUMBER: %(num)%(lit)%<(num 3) yes%| no%>\n\
16X-NOSTRING: %(num 3)%(lit x)%<(lit) found%| missing%>\n\
17X-NONUMBER: %(num 3)%(lit x)%<(num) yes%| no%>\n\
18--------
19EOF
20
21expected=$MH_TEST_DIR/$$.expected
22actual=$MH_TEST_DIR/Mail/drafts/1
23
24cat > $expected <<EOF
25X-STRING: 0 found
26X-NUMBER: 0 yes
27X-NOSTRING: 3x missing
28X-NONUMBER: 3x no
29--------
30> part       text/plain                  25
31> This is message number 1
32EOF
33
34repl -editor true -form $form -group -nocc me -whatnowproc true 1
35
36diff -u $expected $actual
37