From df54de37b0a372a49bed0130406a5b75b85cd119 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Tue, 21 Nov 2023 11:29:30 +1100 Subject: Bug [#2413]. Fix regular expression search failure. --- test/unit/testRESearch.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/unit/testRESearch.cxx b/test/unit/testRESearch.cxx index 781d776a4..9bc1b43bb 100644 --- a/test/unit/testRESearch.cxx +++ b/test/unit/testRESearch.cxx @@ -60,6 +60,17 @@ TEST_CASE("RESearch") { REQUIRE(nullptr == msg); } + SECTION("Bug2413") { + // Check for https://sourceforge.net/p/scintilla/bugs/2413/ + std::unique_ptr re = std::make_unique(&cc); + constexpr std::string_view BOW = "\\<"; + constexpr std::string_view EOW = "\\>"; + const char *msg = re->Compile(BOW.data(), BOW.length(), true, false); + REQUIRE(nullptr == msg); + msg = re->Compile(EOW.data(), EOW.length(), true, false); + REQUIRE(nullptr == msg); + } + SECTION("Execute") { std::unique_ptr re = std::make_unique(&cc); re->Compile(pattern.data(), pattern.length(), true, false); -- cgit v1.2.3