Commit | Line | Data |
---|---|---|
59371ea7 PH |
1 | # Common string expansions |
2 | # | |
3 | # This is the main string expansion test that tests those expansions that will | |
4 | # be present in the basic Exim binary which we require in order to run these | |
5 | # tests at all. Specialized expansion tests also exist for optional features | |
6 | # in other test scripts. | |
7 | ||
8 | exim -be | |
9 | ||
10 | # These expansions can test variables in the configuration, but as there | |
11 | # is no message being processed, there is no message-related data. But | |
12 | # that of course gets tested in plenty of other places. | |
13 | ||
14 | # Some fixed variables | |
15 | ||
16 | exim_path: $exim_path | |
17 | primary_hostname: $primary_hostname | |
18 | primary_hostname: ${primary_hostname} | |
19 | qualify_domain: $qualify_domain | |
20 | bounce_return_size_limit: ${bounce_return_size_limit} | |
21 | spool_directory: $spool_directory | |
22 | unknown: ${unknown} | |
23 | h_subject: $h_subject:(should be empty) | |
24 | h_subject:$h_subject (should be empty) | |
25 | header in curlies: ${header_subject:} (should fail) | |
26 | ||
27 | # \$message_headers should be empty | |
28 | message_headers: >$message_headers< | |
29 | ||
30 | # Continuation | |
31 | x\ | |
32 | y | |
33 | x\ | |
34 | y | |
35 | ||
36 | # Overlong names and overbig numbers | |
37 | ||
38 | +$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
39 | +${aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} | |
40 | +$11111111111111111111111111111111111 | |
41 | +${11111111111111111111111111111111111} | |
42 | ||
29f89cad PH |
43 | # List operations |
44 | ||
45 | filter: "${filter{a:b:c}{eq{1}{1}}}" | |
46 | filter: ${filter{a:b:c}{!eq{$item}{b}}} | |
47 | filter: ${filter{<' a'b'c}{!eq{$item}{b}}} | |
48 | filter: ${filter{<' ''a'b' ''c}{!eq{$item}{b}}} | |
49 | filter: "${filter{}{!eq{$item}{b}}}" | |
50 | ||
51 | map: "${map{}{$item}}" | |
52 | map: ${map{a:b:c}{$item}} | |
53 | map: ${map{a:b:c}{:$item:}} | |
54 | map: ${if eq{1}{0}{${map{a:b:c}{:$item:}}}{fail string}} | |
55 | map: ${map{:b:c}{[$item]}} | |
56 | ||
57 | reduce: "${reduce{}{+}{$value$item}}" | |
58 | reduce: ${reduce{a:b:c}{+}{$value$item}} | |
59 | reduce: ${reduce {<, 1,2,3}{0}{${eval:$value+$item}}} | |
60 | reduce: ${reduce {3:0:9:4:6}{0}{${if >{$item}{$value}{$item}{$value}}}} | |
61 | ||
ec95d1a6 PH |
62 | # Tests with iscntrl() and illegal separators |
63 | ||
64 | map: ${map{<\n a\n\nb\nc}{'$item'}} | |
65 | ||
66 | reduce: ${reduce {<n 1\n2\n3}{0}{${eval:$value+$item}}} | |
67 | reduce: ${reduce {<\n 1\n2\n3}{0}{${eval:$value+$item}}} | |
68 | reduce: ${reduce { <\n 1\n 2 \n 3 }{0}{${eval:$value+$item}}} | |
69 | reduce: ${reduce {<\x7f 1\x7f2\177 3}{0}{${eval:$value+$item}}} | |
70 | ||
59371ea7 PH |
71 | # Operators |
72 | ||
73 | addrss: ${address:local-part@dom.ain} | |
74 | addrss: ${address:Exim Person <local-part@dom.ain> (that's me)} | |
75 | domain: ${domain:local-part@dom.ain} | |
76 | domain: ${domain:Exim Person <local-part@dom.ain> (that's me)} | |
29f89cad PH |
77 | |
78 | addresses: ${addresses:>' 'abc@xyz, 'pqr@xyz} | |
79 | addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me)} | |
80 | addresses: ${addresses:>+ Exim Person <local-part@dom.ain> (that's me),\ | |
81 | xyz@abc} | |
82 | addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me), \ | |
83 | xyz@abc, nullgroupname:;, group: p@q, r@s; } | |
84 | addresses: ${addresses:local-part@dom.ain <local-part@dom.ain>} | |
85 | ||
59371ea7 PH |
86 |