GNU bug report logs - #51735
[PATCH] tests: fix test logic for pcre-context

Previous Next

Package: grep;

Reported by: Carlo Marcelo Arenas Belón <carenas <at> gmail.com>

Date: Wed, 10 Nov 2021 01:05:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51735 in the body.
You can then email your comments to 51735 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#51735; Package grep. (Wed, 10 Nov 2021 01:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carlo Marcelo Arenas Belón <carenas <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Wed, 10 Nov 2021 01:05:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carlo Marcelo Arenas Belón <carenas <at> gmail.com>
To: bug-grep <at> gnu.org
Cc: Carlo Marcelo Arenas Belón <carenas <at> gmail.com>
Subject: [PATCH] tests: fix test logic for pcre-context
Date: Tue,  9 Nov 2021 17:02:39 -0800
Included in the original bug #20957, but corrupted somehow in
transit as the required NUL characters are missing.

Add a simpler version of the test case that uses plain characters
and match the -z data and output to show the equivalence.

Note the output is still not correct as it is missing the expected
LF characters, but a full fix will have to wait until PCRE2.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas <at> gmail.com>
---
 tests/pcre-context | 40 ++++++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/tests/pcre-context b/tests/pcre-context
index b910a20..77cb863 100755
--- a/tests/pcre-context
+++ b/tests/pcre-context
@@ -4,29 +4,33 @@
 require_pcre_
 
 cat >in <<'EOF'
-Preceded by 0 empty lines.
-
-Preceded by 1 empty line.
-
-
-Preceded by 2 empty lines.
-
-
-
-Preceded by 3 empty lines.
-
-
-
-
-Preceded by 4 empty lines.
+b0
+ab1
+aab2
+aaab3
+aaaab4
+EOF
+test $? -eq 0 || framework_failure_
 
+cat >exp <<'EOF'
+b3
+ab4
 EOF
 test $? -eq 0 || framework_failure_
 
+grep -Po '(?<=aaa).*' in >out || fail_ 'grep -Po failed'
+compare exp out || fail=1
+
+printf 'NUL preceded by 0 empty lines.\0' >in &&
+printf '\nNUL preceded by 1 empty line.\0' >>in &&
+printf '\n\nNUL preceded by 2 empty lines.\0' >>in &&
+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_
+
 printf '%s\0' \
-       'Preceded by 2 empty lines.' \
-       'Preceded by 3 empty lines.' \
-       'Preceded by 4 empty lines.' >exp || framework_failure_
+       'NUL preceded by 3 empty lines.' \
+       'NUL preceded by 4 empty lines.' >exp || framework_failure_
 
 fail=0
 
-- 
2.34.0.rc1.349.g8f33748433





Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Thu, 11 Nov 2021 02:26:01 GMT) Full text and rfc822 format available.

Notification sent to Carlo Marcelo Arenas Belón <carenas <at> gmail.com>:
bug acknowledged by developer. (Thu, 11 Nov 2021 02:26:01 GMT) Full text and rfc822 format available.

Message #10 received at 51735-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Carlo Marcelo Arenas Belón <carenas <at> gmail.com>
Cc: 51735-done <at> debbugs.gnu.org
Subject: Re: bug#51735: [PATCH] tests: fix test logic for pcre-context
Date: Wed, 10 Nov 2021 18:25:18 -0800
[Message part 1 (text/plain, inline)]
Thanks, I installed that with the attached minor fixup patch afterwards.
[0001-tests-fix-pcre-test-typo.patch (text/x-patch, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 09 Dec 2021 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.