Subject: Re: bug#51735: [PATCH] tests: fix test logic for pcre-context

From: Paul Eggert <[email-masked]>
Date: Wed, 10 Nov 2021 18:25:18 -0800

Thanks, I installed that with the attached minor fixup patch afterwards.

From 015d028d0598f31d5aa25e5c47dfe8872afb4e6e Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Wed, 10 Nov 2021 18:23:49 -0800
Subject: [PATCH] tests: fix pcre test typo
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* tests/pcre-context: Initialize ‘fail’ earlier.
---
 tests/pcre-context | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/pcre-context b/tests/pcre-context
index 77cb863..d66bebb 100755
--- a/tests/pcre-context
+++ b/tests/pcre-context
@@ -18,6 +18,8 @@ ab4
 EOF
 test $? -eq 0 || framework_failure_
 
+fail=0
+
 grep -Po '(?<=aaa).*' in >out || fail_ 'grep -Po failed'
 compare exp out || fail=1
 
@@ -28,12 +30,12 @@ printf '\n\n\nNUL preceded by 3 empty lines.\0' >>in &&
 printf '\n\n\n\nNUL preceded by 4 empty lines.\0' >>in &&
 printf '\n' >>in || framework_failure_
 
+# This output is not correct as it is missing the expected LF characters,
+# but a full fix will have to wait until PCRE2.
 printf '%s\0' \
        'NUL preceded by 3 empty lines.' \
        'NUL preceded by 4 empty lines.' >exp || framework_failure_
 
-fail=0
-
 grep -Pzo '(?<=\n\n\n).*' in >out || fail_ 'grep -Pzo failed'
 compare exp out || fail=1
 
-- 
2.33.1