From unknown Tue Jun 17 01:46:35 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51735: [PATCH] tests: fix test logic for pcre-context Resent-From: Carlo Marcelo Arenas =?UTF-8?Q?Bel=C3=B3n?= Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Wed, 10 Nov 2021 01:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51735 X-GNU-PR-Package: grep X-GNU-PR-Keywords: patch To: 51735@debbugs.gnu.org Cc: Carlo Marcelo Arenas =?UTF-8?Q?Bel=C3=B3n?= X-Debbugs-Original-To: bug-grep@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163650625432705 (code B ref -1); Wed, 10 Nov 2021 01:05:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Nov 2021 01:04:14 +0000 Received: from localhost ([127.0.0.1]:36349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkc29-0008VR-OK for submit@debbugs.gnu.org; Tue, 09 Nov 2021 20:04:13 -0500 Received: from lists.gnu.org ([209.51.188.17]:37908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkc26-0008VI-Rd for submit@debbugs.gnu.org; Tue, 09 Nov 2021 20:04:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkc26-0005kW-Dp for bug-grep@gnu.org; Tue, 09 Nov 2021 20:04:10 -0500 Received: from [2607:f8b0:4864:20::72a] (port=37474 helo=mail-qk1-x72a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mkc24-0007fh-Tl for bug-grep@gnu.org; Tue, 09 Nov 2021 20:04:10 -0500 Received: by mail-qk1-x72a.google.com with SMTP id r8so940420qkp.4 for ; Tue, 09 Nov 2021 17:04:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nSAH59cp4JXr3iMUYCwgl4rUtspIqWA3FIHAsBlu5N8=; b=eglyRjYA2MRHWsAek/lrVflikCkC94Bkgty2wDgWfqgLwSQhaJGS2dLHHjsMZ+YISp uHC99tdX9R4xu5uIqBrls2tDdg4L4qE++a/5khCcCZk7ZIzTlrlhU9bu3KD9kItbmB1y C4nR+lHM/9dXHeWu/+XJ4WIx8hlOUpooaxCgJMj56edbbDL2BB25KvX1FP4JkStrXCP/ AnPa035KAbf/2UYkm8uCVMl7zLDcZHbkE5ER9NAIUQ2kaht2D6dbYZiSDqOyjZVj23uK cQX+jvZrZwrVbUZiw66idocXQgvB5hUoYRFeyHQMHRaLw4VBAD4PnaLlcy+NSlJaUsz5 iydQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nSAH59cp4JXr3iMUYCwgl4rUtspIqWA3FIHAsBlu5N8=; b=I1G9jf5QtirBk8+pM/u5R6yC6adHPUfi0GXFPy7626wOpaBkRNnr++kI/2XzXl4t5t UjAL02DyLefPYRd0QCWMRujtOrmB4p5Q7qyz0mX+XCQitbxZMIPyc6PN5JrZSAUeOczs +jDNHkjH+y/0Np/OHx5a5gCmipIBV4ocAuBZtCYx3k8PauxkeBZu3tCAzQrUqo6gnzmr OWMGjjuTrDl5MTiYdQV3v7MtOqw0mlxwL3Hl7ZhPKmcd2tiZUYzWl59dc5+GVUnHnHBR 21pTE0rfrWuax/ABZ/Y/m4HGnKJhJ6NfswASTp2RjBzWk27QWLhwj1v9RqBzMLVD2C0x NqbA== X-Gm-Message-State: AOAM533n6m/I+p9L1tmsZfxH7VcDwMDin2WZ8XtDWR1CZgZLqRUMkHeU wZb4CwGRkffB5FbtwDKd9z3vfluNpbw= X-Google-Smtp-Source: ABdhPJzeCqjyKAHDaIVOtqYZF7GfaXbxhCxNcjtDxTkVAtquKDhMGQj/RuxeeH5gaHNJ22QTBAQTMg== X-Received: by 2002:a05:620a:298a:: with SMTP id r10mr9111534qkp.317.1636506247619; Tue, 09 Nov 2021 17:04:07 -0800 (PST) Received: from carlos-mbp.lan (104-1-92-200.lightspeed.sntcca.sbcglobal.net. [104.1.92.200]) by smtp.gmail.com with ESMTPSA id v15sm12849550qkl.91.2021.11.09.17.04.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Nov 2021 17:04:07 -0800 (PST) From: Carlo Marcelo Arenas =?UTF-8?Q?Bel=C3=B3n?= Date: Tue, 9 Nov 2021 17:02:39 -0800 Message-Id: <20211110010239.98247-1-carenas@gmail.com> X-Mailer: git-send-email 2.34.0.rc1.349.g8f33748433 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::72a (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=carenas@gmail.com; helo=mail-qk1-x72a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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 --- 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 From unknown Tue Jun 17 01:46:35 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Carlo Marcelo Arenas =?UTF-8?Q?Bel=C3=B3n?= Subject: bug#51735: closed (Re: bug#51735: [PATCH] tests: fix test logic for pcre-context) Message-ID: References: <20211110010239.98247-1-carenas@gmail.com> X-Gnu-PR-Message: they-closed 51735 X-Gnu-PR-Package: grep X-Gnu-PR-Keywords: patch Reply-To: 51735@debbugs.gnu.org Date: Thu, 11 Nov 2021 02:26:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1636597561-16817-1" This is a multi-part message in MIME format... ------------=_1636597561-16817-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #51735: [PATCH] tests: fix test logic for pcre-context which was filed against the grep package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 51735@debbugs.gnu.org. --=20 51735: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D51735 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1636597561-16817-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 51735-done) by debbugs.gnu.org; 11 Nov 2021 02:25:29 +0000 Received: from localhost ([127.0.0.1]:39587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkzmK-0004MT-R1 for submit@debbugs.gnu.org; Wed, 10 Nov 2021 21:25:29 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkzmH-0004MF-Nk for 51735-done@debbugs.gnu.org; Wed, 10 Nov 2021 21:25:27 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A027F160051; Wed, 10 Nov 2021 18:25:19 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 8HxvGO4BFdVk; Wed, 10 Nov 2021 18:25:18 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D7CBA160083; Wed, 10 Nov 2021 18:25:18 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Pb6JJguir1xT; Wed, 10 Nov 2021 18:25:18 -0800 (PST) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B7DDC160051; Wed, 10 Nov 2021 18:25:18 -0800 (PST) Content-Type: multipart/mixed; boundary="------------fB5Bkh2X4fCvkkOXH4ZCI382" Message-ID: Date: Wed, 10 Nov 2021 18:25:18 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: bug#51735: [PATCH] tests: fix test logic for pcre-context Content-Language: en-US To: =?UTF-8?Q?Carlo_Marcelo_Arenas_Bel=c3=b3n?= References: <20211110010239.98247-1-carenas@gmail.com> From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: <20211110010239.98247-1-carenas@gmail.com> X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 51735-done Cc: 51735-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.4 (---) This is a multi-part message in MIME format. --------------fB5Bkh2X4fCvkkOXH4ZCI382 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thanks, I installed that with the attached minor fixup patch afterwards. --------------fB5Bkh2X4fCvkkOXH4ZCI382 Content-Type: text/x-patch; charset=UTF-8; name="0001-tests-fix-pcre-test-typo.patch" Content-Disposition: attachment; filename="0001-tests-fix-pcre-test-typo.patch" Content-Transfer-Encoding: base64 RnJvbSAwMTVkMDI4ZDA1OThmMzFkNWFhMjVlNWM0N2RmZTg4NzJhZmI0ZTZlIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBXZWQsIDEwIE5vdiAyMDIxIDE4OjIzOjQ5IC0wODAwClN1YmplY3Q6IFtQQVRD SF0gdGVzdHM6IGZpeCBwY3JlIHRlc3QgdHlwbwpNSU1FLVZlcnNpb246IDEuMApDb250ZW50 LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9VVRGLTgKQ29udGVudC1UcmFuc2Zlci1FbmNv ZGluZzogOGJpdAoKKiB0ZXN0cy9wY3JlLWNvbnRleHQ6IEluaXRpYWxpemUg4oCYZmFpbOKA mSBlYXJsaWVyLgotLS0KIHRlc3RzL3BjcmUtY29udGV4dCB8IDYgKysrKy0tCiAxIGZpbGUg Y2hhbmdlZCwgNCBpbnNlcnRpb25zKCspLCAyIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBh L3Rlc3RzL3BjcmUtY29udGV4dCBiL3Rlc3RzL3BjcmUtY29udGV4dAppbmRleCA3N2NiODYz Li5kNjZiZWJiIDEwMDc1NQotLS0gYS90ZXN0cy9wY3JlLWNvbnRleHQKKysrIGIvdGVzdHMv cGNyZS1jb250ZXh0CkBAIC0xOCw2ICsxOCw4IEBAIGFiNAogRU9GCiB0ZXN0ICQ/IC1lcSAw IHx8IGZyYW1ld29ya19mYWlsdXJlXwogCitmYWlsPTAKKwogZ3JlcCAtUG8gJyg/PD1hYWEp LionIGluID5vdXQgfHwgZmFpbF8gJ2dyZXAgLVBvIGZhaWxlZCcKIGNvbXBhcmUgZXhwIG91 dCB8fCBmYWlsPTEKIApAQCAtMjgsMTIgKzMwLDEyIEBAIHByaW50ZiAnXG5cblxuTlVMIHBy ZWNlZGVkIGJ5IDMgZW1wdHkgbGluZXMuXDAnID4+aW4gJiYKIHByaW50ZiAnXG5cblxuXG5O VUwgcHJlY2VkZWQgYnkgNCBlbXB0eSBsaW5lcy5cMCcgPj5pbiAmJgogcHJpbnRmICdcbicg Pj5pbiB8fCBmcmFtZXdvcmtfZmFpbHVyZV8KIAorIyBUaGlzIG91dHB1dCBpcyBub3QgY29y cmVjdCBhcyBpdCBpcyBtaXNzaW5nIHRoZSBleHBlY3RlZCBMRiBjaGFyYWN0ZXJzLAorIyBi dXQgYSBmdWxsIGZpeCB3aWxsIGhhdmUgdG8gd2FpdCB1bnRpbCBQQ1JFMi4KIHByaW50ZiAn JXNcMCcgXAogICAgICAgICdOVUwgcHJlY2VkZWQgYnkgMyBlbXB0eSBsaW5lcy4nIFwKICAg ICAgICAnTlVMIHByZWNlZGVkIGJ5IDQgZW1wdHkgbGluZXMuJyA+ZXhwIHx8IGZyYW1ld29y a19mYWlsdXJlXwogCi1mYWlsPTAKLQogZ3JlcCAtUHpvICcoPzw9XG5cblxuKS4qJyBpbiA+ b3V0IHx8IGZhaWxfICdncmVwIC1Qem8gZmFpbGVkJwogY29tcGFyZSBleHAgb3V0IHx8IGZh aWw9MQogCi0tIAoyLjMzLjEKCg== --------------fB5Bkh2X4fCvkkOXH4ZCI382-- ------------=_1636597561-16817-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 10 Nov 2021 01:04:14 +0000 Received: from localhost ([127.0.0.1]:36349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkc29-0008VR-OK for submit@debbugs.gnu.org; Tue, 09 Nov 2021 20:04:13 -0500 Received: from lists.gnu.org ([209.51.188.17]:37908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkc26-0008VI-Rd for submit@debbugs.gnu.org; Tue, 09 Nov 2021 20:04:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkc26-0005kW-Dp for bug-grep@gnu.org; Tue, 09 Nov 2021 20:04:10 -0500 Received: from [2607:f8b0:4864:20::72a] (port=37474 helo=mail-qk1-x72a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mkc24-0007fh-Tl for bug-grep@gnu.org; Tue, 09 Nov 2021 20:04:10 -0500 Received: by mail-qk1-x72a.google.com with SMTP id r8so940420qkp.4 for ; Tue, 09 Nov 2021 17:04:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nSAH59cp4JXr3iMUYCwgl4rUtspIqWA3FIHAsBlu5N8=; b=eglyRjYA2MRHWsAek/lrVflikCkC94Bkgty2wDgWfqgLwSQhaJGS2dLHHjsMZ+YISp uHC99tdX9R4xu5uIqBrls2tDdg4L4qE++a/5khCcCZk7ZIzTlrlhU9bu3KD9kItbmB1y C4nR+lHM/9dXHeWu/+XJ4WIx8hlOUpooaxCgJMj56edbbDL2BB25KvX1FP4JkStrXCP/ AnPa035KAbf/2UYkm8uCVMl7zLDcZHbkE5ER9NAIUQ2kaht2D6dbYZiSDqOyjZVj23uK cQX+jvZrZwrVbUZiw66idocXQgvB5hUoYRFeyHQMHRaLw4VBAD4PnaLlcy+NSlJaUsz5 iydQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nSAH59cp4JXr3iMUYCwgl4rUtspIqWA3FIHAsBlu5N8=; b=I1G9jf5QtirBk8+pM/u5R6yC6adHPUfi0GXFPy7626wOpaBkRNnr++kI/2XzXl4t5t UjAL02DyLefPYRd0QCWMRujtOrmB4p5Q7qyz0mX+XCQitbxZMIPyc6PN5JrZSAUeOczs +jDNHkjH+y/0Np/OHx5a5gCmipIBV4ocAuBZtCYx3k8PauxkeBZu3tCAzQrUqo6gnzmr OWMGjjuTrDl5MTiYdQV3v7MtOqw0mlxwL3Hl7ZhPKmcd2tiZUYzWl59dc5+GVUnHnHBR 21pTE0rfrWuax/ABZ/Y/m4HGnKJhJ6NfswASTp2RjBzWk27QWLhwj1v9RqBzMLVD2C0x NqbA== X-Gm-Message-State: AOAM533n6m/I+p9L1tmsZfxH7VcDwMDin2WZ8XtDWR1CZgZLqRUMkHeU wZb4CwGRkffB5FbtwDKd9z3vfluNpbw= X-Google-Smtp-Source: ABdhPJzeCqjyKAHDaIVOtqYZF7GfaXbxhCxNcjtDxTkVAtquKDhMGQj/RuxeeH5gaHNJ22QTBAQTMg== X-Received: by 2002:a05:620a:298a:: with SMTP id r10mr9111534qkp.317.1636506247619; Tue, 09 Nov 2021 17:04:07 -0800 (PST) Received: from carlos-mbp.lan (104-1-92-200.lightspeed.sntcca.sbcglobal.net. [104.1.92.200]) by smtp.gmail.com with ESMTPSA id v15sm12849550qkl.91.2021.11.09.17.04.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Nov 2021 17:04:07 -0800 (PST) From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= To: bug-grep@gnu.org Subject: [PATCH] tests: fix test logic for pcre-context Date: Tue, 9 Nov 2021 17:02:39 -0800 Message-Id: <20211110010239.98247-1-carenas@gmail.com> X-Mailer: git-send-email 2.34.0.rc1.349.g8f33748433 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::72a (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=carenas@gmail.com; helo=mail-qk1-x72a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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 --- 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 ------------=_1636597561-16817-1--