X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/60a4ceafecdf10647d01127bdae8252fc5b84508..37b849dca4dfd855212a763662825e:/test/scripts/0000-Basic/0002 diff --git a/test/scripts/0000-Basic/0002 b/test/scripts/0000-Basic/0002 index e74ca6e39..c1fa1bdb5 100644 --- a/test/scripts/0000-Basic/0002 +++ b/test/scripts/0000-Basic/0002 @@ -90,6 +90,8 @@ filter: ${filter{a:b:c}{!eq{$item}{b}}} filter: ${filter{<' a'b'c}{!eq{$item}{b}}} filter: ${filter{<' ''a'b' ''c}{!eq{$item}{b}}} filter: "${filter{}{!eq{$item}{b}}}" +# check operation when the condition modifies the 'value' variable +${filter {E} {inlisti{$item}{ e }}} map: "${map{}{$item}}" map: ${map{a:b:c}{$item}} @@ -204,6 +206,20 @@ hex2b64:${hex2b64:1a2b3c4d5e6g} hex2b64:${hex2b64:${md5:the quick brown fox}} hex2b64:${hex2b64:${sha1:the quick brown fox}} +headerwrap:${headerwrap:} +headerwrap:${headerwrap:a} +headerwrap:${headerwrap:ab} +headerwrap:${headerwrap:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz} +headerwrap_79:${headerwrap_79:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz} +headerwrap:${headerwrap:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab} +headerwrap:${headerwrap:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab} +headerwrap:${headerwrap:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab} +headerwrap:${headerwrap:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbz} +headerwrap:${headerwrap:123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(100).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(200).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(300).678901234567890123456789012345678901234567890123456789012345678901234567890123456789(400).67890123456789012345678901234567890123456789012345678901234567890123456789012345\ +67890123456789(500).678901234567890123456789012345678901234567890123456789012345678901234567890123456789(600).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(700).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(800).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(900).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(1000).789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(100).67890123456789} +headerwrap_81_100:${headerwrap_81_100:123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(100).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(200).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(300).678901234567890123456789012345678901234567890123456789012345678901234567890123456789(400).67890123456789012345678901234567890123456789012345678901234567890123456789012345\ +67890123456789(500).678901234567890123456789012345678901234567890123456789012345678901234567890123456789(600).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(700).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(800).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(900).6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(1000).789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(100).67890123456789} + base32: 0 <${base32:0}> base32: 1 <${base32:1}> base32: 31 <${base32:31}> @@ -251,6 +267,7 @@ mask: ${mask:a.b.c.d} mask: ${mask:2a00:2:3:4:5:6:7:8/79} mask: ${mask:2a00:2:3:4:5:6:7:8/128} mask: ${mask:2a00:2:3:4:5:6:7:8/129} +mask_n: ${mask_n:2a00:2:3:4:5:6:7:8/79} ipv6denorm: ${ipv6denorm:::1} ipv6denorm: ${ipv6denorm:fe00::1} ipv6denorm: ${ipv6denorm:192.168.0.1} @@ -441,6 +458,7 @@ ge: ${if ge{ABC}{abc}{y}{n}} gei: ${if gei{ABC}{abc}{y}{n}} isip: ${if isip {1.2.3.4}{y}{n}} 1.2.3.4 +isip: ${if isip {1.2.3}{y}{n}} 1.2.3 isip4: ${if isip4{1.2.3.4}{y}{n}} 1.2.3.4 isip6: ${if isip6{1.2.3.4}{y}{n}} 1.2.3.4 isip: ${if isip {::1.2.3.256}{y}{n}} ::1.2.3.256 @@ -458,12 +476,17 @@ isip: ${if isip {fe80::1.2.3.4}{y}{n}} fe80::1.2.3.4 isip: ${if isip {rhubarb}{y}{n}} rhubarb isip4: ${if isip4{rhubarb}{y}{n}} rhubarb isip6: ${if isip6{rhubarb}{y}{n}} rhubarb +isip6: ${if isip6{::/100}{y}{n}} ::/100 +isip6: ${if isip6{::/foo}{y}{n}} ::/foo +isip6: ${if isip6{::/f o}{y}{n}} ::/f o match: ${if match{abcd}{\N^([ab]+)(\w+)$\N}{$2$1}fail} match: ${if match{abcd}{^\N([ab]+)(\w+)$\N}{$2$1}fail} match: ${if match{abcd}{^([ab]+)(\\w+)\$}{$2$1}fail} match: ${if match{wxyz}{^([ab]+)(\\w+)\$}{$2$1}fail} match: ${if match{abcd}{^([ab]+)(\\w+)\$}{$2[${if match{xyz}{(.*)}{$1}fail}]$1}fail} +# check for empty capture group +match: ${if match{abc}{\N^(\S+)\s*(\S.+)*$\N}{<$2>}{}} match_domain: ${if match_domain{a.b.c}{x.y.z:a.b.c:p.q.r}{yes}{no}} match_domain: ${if match_domain{a.b.c}{x.y.z:p.q.r}{yes}{no}} @@ -695,6 +718,7 @@ abcdea aaa xyz ${tr{abcdea}{aaa}{xyz}} abcdea a z ${tr{abcdea}{a}{z}} abcdea a ${tr{abcdea}{a}{}} abcdea abc z ${tr{abcdea}{abc}{z}} +(null) '${sg{$header_foobar:${tr{}{}{foobar}}}{}{}}' # Boolean "TrUe" ${if bool{TrUe}{true}{false}} EXPECT: true @@ -801,6 +825,10 @@ rc=$runrc rc=$runrc ${if eq{1}{2}{${run{/non/exist}}}{1!=2}} rc=$runrc +${run,preexpand {DIR/aux-fixed/0002.runfile 0}} +rc=$runrc +${run{DIR/aux-fixed/0002.runfile ${quote:1}}{$value}{2}} +rc=$runrc # PRVS @@ -959,6 +987,13 @@ expect: <> <${extract jsons{nonexistent}{ \{"id": \{"a":101, "b":102\}, "IDs": \{"1":116, "2":943, "3":234\}\} }}> expect: <> +# string value with embedded comma +<${extract jsons{name}{ \{ "id":"1","name":"Doe, John","age":"unknown" \}}}> +expect +# string value with embedded doublequote +<${extract jsons{name}{ \{ "id":"1","name":"word1 \\\" word2","age":"unknown" \}}}> +expect + ${if forany_json {[1, 2, 3]}{={$item}{1}}{yes}{no}} ${if forany_jsons{["A", "B", "C"]}{eq{$item}{B}}{yes}{no}}