summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2022-11-11 18:22:00 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2022-11-11 19:52:19 +0000
commit7ad1a2b2cc57b5f4bcb59186a9a8abcbed9f4f76 (patch)
tree5872f7fd3de6384f962d5480d88f3501bbaa624c /test
parente63825824cc406c160ccbf2b154c5d81b168604a (diff)
downloadexim4-7ad1a2b2cc57b5f4bcb59186a9a8abcbed9f4f76.tar.gz
Fix regex substring capture variables for null matches (again). Bug 2933
Broken-by: 59d66fdc13f0
Diffstat (limited to 'test')
-rw-r--r--test/aux-var-src/0383.F4
-rw-r--r--test/log/03834
-rw-r--r--test/mail/0383.CALLER8
-rw-r--r--test/scripts/0000-Basic/00022
-rw-r--r--test/stdout/00022
5 files changed, 12 insertions, 8 deletions
diff --git a/test/aux-var-src/0383.F b/test/aux-var-src/0383.F
index be69ca2c2..59dd0666a 100644
--- a/test/aux-var-src/0383.F
+++ b/test/aux-var-src/0383.F
@@ -3,7 +3,7 @@
if error_message then finish endif
if foranyaddress $h_to: ($thisaddress matches "^(alice)") then
- pipe "DIR/aux-fixed/showenv \"${if match_address {$thisaddress}{alice@test.ex}{$value}}\" $1"
+ pipe "DIR/aux-fixed/showenv \"${if match_address {$thisaddress}{alice@test.ex}{$value}}\" \"${if inlist {$1}{alice} {$value}}\""
finish
endif
@@ -13,6 +13,6 @@ if foranyaddress $h_to: ($thisaddress matches "^(marny)") then
endif
if $h_to: matches "^(j..)" then
- pipe "DIR/aux-fixed/showenv $1"
+ pipe "DIR/aux-fixed/showenv \"${if inlist {$1}{jab} {$value}}\""
endif
diff --git a/test/log/0383 b/test/log/0383
index 7018dd54e..0909b177f 100644
--- a/test/log/0383
+++ b/test/log/0383
@@ -1,6 +1,6 @@
1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@test.ex U=CALLER P=local S=sss for alice
1999-03-02 09:44:33 10HmaX-0005vi-00 original recipients ignored (system filter)
-1999-03-02 09:44:33 10HmaX-0005vi-00 ** |TESTSUITE/aux-fixed/showenv "${if match_address {$thisaddress}{alice@test.ex}{$value}}" $1 <system-filter> T=t1: return message generated
+1999-03-02 09:44:33 10HmaX-0005vi-00 ** |TESTSUITE/aux-fixed/showenv "${if match_address {$thisaddress}{alice@test.ex}{$value}}" "${if inlist {$1}{alice} {$value}}" <system-filter> T=t1: return message generated
1999-03-02 09:44:33 10HmaY-0005vi-00 <= <> R=10HmaX-0005vi-00 U=EXIMUSER P=local S=sss for CALLER@test.ex
1999-03-02 09:44:33 10HmaY-0005vi-00 => CALLER <CALLER@test.ex> R=r1 T=t2
1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
@@ -14,7 +14,7 @@
1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
1999-03-02 09:44:33 10HmbB-0005vi-00 <= CALLER@test.ex U=CALLER P=local S=sss for jabberwocky
1999-03-02 09:44:33 10HmbB-0005vi-00 original recipients ignored (system filter)
-1999-03-02 09:44:33 10HmbB-0005vi-00 ** |TESTSUITE/aux-fixed/showenv $1 <system-filter> T=t1: return message generated
+1999-03-02 09:44:33 10HmbB-0005vi-00 ** |TESTSUITE/aux-fixed/showenv "${if inlist {$1}{jab} {$value}}" <system-filter> T=t1: return message generated
1999-03-02 09:44:33 10HmbC-0005vi-00 <= <> R=10HmbB-0005vi-00 U=EXIMUSER P=local S=sss for CALLER@test.ex
1999-03-02 09:44:33 10HmbC-0005vi-00 => CALLER <CALLER@test.ex> R=r1 T=t2
1999-03-02 09:44:33 10HmbC-0005vi-00 Completed
diff --git a/test/mail/0383.CALLER b/test/mail/0383.CALLER
index fb2f4f25c..67bb42f41 100644
--- a/test/mail/0383.CALLER
+++ b/test/mail/0383.CALLER
@@ -22,12 +22,12 @@ This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
- pipe to |TESTSUITE/aux-fixed/showenv "${if match_address {$thisaddress}{alice@test.ex}{$value}}" $1
+ pipe to |TESTSUITE/aux-fixed/showenv "${if match_address {$thisaddress}{alice@test.ex}{$value}}" "${if inlist {$1}{alice} {$value}}"
generated by system-filter
The following text was generated during the delivery attempt:
------- pipe to |TESTSUITE/aux-fixed/showenv "${if match_address {$thisaddress}{alice@test.ex}{$value}}" $1
+------ pipe to |TESTSUITE/aux-fixed/showenv "${if match_address {$thisaddress}{alice@test.ex}{$value}}" "${if inlist {$1}{alice} {$value}}"
generated by system-filter ------
Test pipe script
@@ -175,12 +175,12 @@ This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
- pipe to |TESTSUITE/aux-fixed/showenv $1
+ pipe to |TESTSUITE/aux-fixed/showenv "${if inlist {$1}{jab} {$value}}"
generated by system-filter
The following text was generated during the delivery attempt:
------- pipe to |TESTSUITE/aux-fixed/showenv $1
+------ pipe to |TESTSUITE/aux-fixed/showenv "${if inlist {$1}{jab} {$value}}"
generated by system-filter ------
Test pipe script
diff --git a/test/scripts/0000-Basic/0002 b/test/scripts/0000-Basic/0002
index 898f3b6bc..1efcb2adc 100644
--- a/test/scripts/0000-Basic/0002
+++ b/test/scripts/0000-Basic/0002
@@ -467,6 +467,8 @@ 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}}
diff --git a/test/stdout/0002 b/test/stdout/0002
index 9232089f6..835d00528 100644
--- a/test/stdout/0002
+++ b/test/stdout/0002
@@ -443,6 +443,8 @@ newline tab\134backslash ~tilde\177DEL\200\201.
> match: cdab
> Failed: "if" failed and "fail" requested
> match: cd[xyz]ab
+> # check for empty capture group
+> match: <>
>
> match_domain: yes
> match_domain: no