remove broken agrep test entry (fails with bash >= 5.2)

Signed-off-by: cherry530 <707078654@qq.com>
This commit is contained in:
cherry530 2023-07-22 16:03:53 +08:00
parent fed64f1b5e
commit 5d244b47db
2 changed files with 116 additions and 2 deletions

View File

@ -0,0 +1,108 @@
From 35f61f40d6b68928ca5d409fa9fc204ea77e2199 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.de>
Date: Tue, 11 Oct 2022 11:35:53 +0200
Subject: [PATCH] Remove broken agrep test entry
It's meant to cause agrep to return with exit code 2, but asserts that it's
exit code 1 instead.
It's meant to ensure that using ".*" as pattern results in exit code 2 because
it matches also an empty string. However, glob expansion results in ".*"
picking up files such as "." and ".." from the CWD, which get interpreted as
valid pattern. This results in exit status 1 (no match found) which is what
the .ok file expects, but that's invalid.
With bash 5.2, glob expansion no longer matches "." and ".." by default, so
the test works as intended by accident, causing a mismatch with the expected
wrong exit code.
It's unfortunately not easily possible to avoid glob expansion in this case.
Just remove the test for now.
---
tests/agrep/exitstatus.args | 1 -
tests/agrep/exitstatus.ok | 61 -------------------------------------
2 files changed, 62 deletions(-)
diff --git a/tests/agrep/exitstatus.args b/tests/agrep/exitstatus.args
index 808ae77..2f53e97 100644
--- a/tests/agrep/exitstatus.args
+++ b/tests/agrep/exitstatus.args
@@ -5,6 +5,5 @@ this-wont-be-found
.
-v .
# Some errors which should give exit status 2.
--d .* dummy
-d {1 dummy
\
diff --git a/tests/agrep/exitstatus.ok b/tests/agrep/exitstatus.ok
index 28427bb..bd23b4c 100644
--- a/tests/agrep/exitstatus.ok
+++ b/tests/agrep/exitstatus.ok
@@ -521,67 +521,6 @@ Exit status 1.
Exit status 1.
#### TEST: agrep -H -n -s --color --show-position -v . < exitstatus.in
-Exit status 1.
-#### TEST: agrep -d .* dummy exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -d .* dummy < exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -c -d .* dummy exitstatus.in
-exitstatus.in:0
-
-Exit status 1.
-#### TEST: agrep -c -d .* dummy < exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -H -d .* dummy exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -H -d .* dummy < exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -l -d .* dummy exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -l -d .* dummy < exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -n -d .* dummy exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -n -d .* dummy < exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -s -d .* dummy exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -s -d .* dummy < exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -M -d .* dummy exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -M -d .* dummy < exitstatus.in
-
-Exit status 1.
-#### TEST: agrep --show-position -d .* dummy exitstatus.in
-
-Exit status 1.
-#### TEST: agrep --show-position -d .* dummy < exitstatus.in
-
-Exit status 1.
-#### TEST: agrep --color -d .* dummy exitstatus.in
-
-Exit status 1.
-#### TEST: agrep --color -d .* dummy < exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -H -n -s --color --show-position -d .* dummy exitstatus.in
-
-Exit status 1.
-#### TEST: agrep -H -n -s --color --show-position -d .* dummy < exitstatus.in
-
Exit status 1.
#### TEST: agrep -d {1 dummy exitstatus.in

View File

@ -2,7 +2,7 @@
%global shortcommit %(c=%{commit}; echo ${c:0:7}) %global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: tre Name: tre
Version: 0.8.0 Version: 0.8.0
Release: 3 Release: 4
License: BSD-2-Clause License: BSD-2-Clause
Source0: https://github.com/laurikari/tre/archive/%{commit}/tre-%{commit}.tar.gz Source0: https://github.com/laurikari/tre/archive/%{commit}/tre-%{commit}.tar.gz
Patch0: %{name}-chicken.patch Patch0: %{name}-chicken.patch
@ -12,6 +12,8 @@ Patch3: %{name}-CVE-2016-8859.patch
Patch4: %{name}-issue37.patch Patch4: %{name}-issue37.patch
Patch5: %{name}-issue50.patch Patch5: %{name}-issue50.patch
Patch10: %{name}-python3.patch Patch10: %{name}-python3.patch
Patch11: Remove-broken-agrep-test-entry.patch
Summary: POSIX compatible regexp library with approximate matching Summary: POSIX compatible regexp library with approximate matching
URL: http://laurikari.net/tre/ URL: http://laurikari.net/tre/
BuildRequires: gettext-devel glibc-langpack-en libtool python3-devel glibc-all-langpacks BuildRequires: gettext-devel glibc-langpack-en libtool python3-devel glibc-all-langpacks
@ -63,6 +65,7 @@ regexps of any length, any number of errors, and non-uniform costs.
%patch4 -p1 -b .issue37 %patch4 -p1 -b .issue37
%patch5 -p1 -b .issue50 %patch5 -p1 -b .issue50
%patch10 -p1 %patch10 -p1
%patch11 -p1
touch ChangeLog touch ChangeLog
autoreconf -vif autoreconf -vif
@ -110,8 +113,11 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
%{_mandir}/man1/agrep.1* %{_mandir}/man1/agrep.1*
%changelog %changelog
* Sat Jul 22 2023 xu_ping <707078654@qq.com> - 0.8.0-4
- Fix test failure
* Mon Nov 14 2022 huajingyun <huajingyun@loongson.cn> - 0.8.0-3 * Mon Nov 14 2022 huajingyun <huajingyun@loongson.cn> - 0.8.0-3
- Fix build error on loongarch - Fix build error on loongarch
* Tue May 10 2022 caodongxia <caodongxia@h-partners.com> - 0.8.0-2 * Tue May 10 2022 caodongxia <caodongxia@h-partners.com> - 0.8.0-2
- License compliance rectification - License compliance rectification