Compare commits

..

No commits in common. "535f8a63152ce307582e98e4163d8e05870dd06b" and "5728972c451ec9e78150fa0cb3625141b8e2e1f3" have entirely different histories.

4 changed files with 7 additions and 67 deletions

BIN
2021-11-01.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,42 +0,0 @@
From 1e89b6846a1a2597a7e9c4ad23842e6be534b87e Mon Sep 17 00:00:00 2001
From: zhouyh <zhouyihang3@h-partners.com>
Date: Wed, 14 Dec 2022 18:42:49 +0800
Subject: [PATCH] add some testcases for abnormal branches
---
re2/testing/re2_test.cc | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/re2/testing/re2_test.cc b/re2/testing/re2_test.cc
index b1f7d73..51a1739 100644
--- a/re2/testing/re2_test.cc
+++ b/re2/testing/re2_test.cc
@@ -211,6 +211,16 @@ TEST(CheckRewriteString, all) {
TestCheckRewriteString("a(b)(c)", "f\\oo\\1", false);
}
+TEST(RE2, Rewrite) {
+ RE2 re("(foo)|(bar)baz");
+ StringPiece group[4];
+ std::string out;
+
+ ASSERT_FALSE(re.Rewrite(&out, "hello\\5", group, arraysize(group)));
+ ASSERT_FALSE(re.Rewrite(&out,"hello\\a", group, arraysize(group)));
+ ASSERT_TRUE(re.Rewrite(&out,"hello\\\\", group, arraysize(group)));
+}
+
TEST(RE2, Extract) {
std::string s;
@@ -360,6 +370,8 @@ TEST(RE2, Match) {
ASSERT_EQ(group[1], "chrisr:9000");
ASSERT_EQ(group[2], "chrisr");
ASSERT_EQ(group[3], "9000");
+ ASSERT_FALSE(
+ re.Match(s, 2, 1, RE2::UNANCHORED, group, arraysize(group)));
std::string all, host;
int port;
--
2.33.0

View File

@ -1,12 +1,11 @@
Name: re2 Name: re2
Version: 20240201 Version: 20211101
Release: 1 Release: 1
Summary: Provide backtracking RE engine Summary: Provide backtracking RE engine
License: BSD License: BSD
URL: http://github.com/google/re2/ URL: http://github.com/google/re2/
Source0: https://github.com/google/re2/archive/2024-02-01.tar.gz Source0: https://github.com/google/re2/archive/2021-11-01.tar.gz
Patch1: add-some-testcases-for-abnormal-branches.patch BuildRequires: gcc-c++
BuildRequires: gcc-c++ abseil-cpp-devel
%description %description
RE2 is a fast, safe, thread-friendly alternative to backtracking regular RE2 is a fast, safe, thread-friendly alternative to backtracking regular
@ -21,11 +20,10 @@ This package contains C ++ header files and symbolic links to re2's shared libra
If you want to develop programs using re2, you need to install re2-devel. If you want to develop programs using re2, you need to install re2-devel.
%prep %prep
%autosetup -n %{name}-2024-02-01 -p1 %autosetup -n %{name}-2021-11-01 -p1
%build %build
sed -i 's/RE2_LDFLAGS?=-pthread/RE2_LDFLAGS?=-pthread -Wl,--as-needed/g' Makefile %make_build CXXFLAGS="${CXXFLAGS:-%optflags} -pthread -std=c++11" \
%make_build CXXFLAGS="${CXXFLAGS:-%optflags} -pthread -std=c++17" \
LDFLAGS="${LDFLAGS:-%__global_ldflags} -pthread" \ LDFLAGS="${LDFLAGS:-%__global_ldflags} -pthread" \
includedir=%{_includedir} libdir=%{_libdir} includedir=%{_includedir} libdir=%{_libdir}
@ -33,8 +31,7 @@ sed -i 's/RE2_LDFLAGS?=-pthread/RE2_LDFLAGS?=-pthread -Wl,--as-needed/g' Makefil
%make_install includedir=%{_includedir} libdir=%{_libdir} %make_install includedir=%{_includedir} libdir=%{_libdir}
%check %check
export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}:LD_LIBRARY_PATH make %{?_smp_mflags} shared-test
%ctest || true
%post %post
/sbin/ldconfig /sbin/ldconfig
@ -43,7 +40,7 @@ export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}:LD_LIBRARY_PATH
/sbin/ldconfig /sbin/ldconfig
%files %files
%doc README LICENSE %doc AUTHORS CONTRIBUTORS README LICENSE
%{_libdir}/lib%{name}.so.* %{_libdir}/lib%{name}.so.*
%files devel %files devel
@ -52,21 +49,6 @@ export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}:LD_LIBRARY_PATH
%exclude %{_libdir}/libre2.a %exclude %{_libdir}/libre2.a
%changelog %changelog
* Wed Feb 07 2024 gaihuiying <eaglegai@163.com> - 20240201-1
- update to 20240201
* Tue Jan 23 2024 gaihuiying <eaglegai@163.com> - 20230901-2
- add '-Wl, --as-needed' for re2 to link dynamic library
* Wed Oct 18 2023 wulei <wu_lei@hoperun.com> - 20230901-1
- Update to 20230901
* Wed Dec 14 2022 zhouyihang <zhouyihang3@h-partners.com> - 20211101-3
- add some testcases for abnormal branches
* Mon Oct 24 2022 gaihuiying <eaglegai@163.com> - 20211101-2
- fix 64 to 32 bit clang conversion warning
* Sat Mar 19 2022 xihaochen <xihaochen@h-partners.com> - 20211101-1 * Sat Mar 19 2022 xihaochen <xihaochen@h-partners.com> - 20211101-1
- upgrade to 20211101 - upgrade to 20211101