Skip to content

Commit a36de2c

Browse files
committed
Ensure regex is non greedy.
1 parent 22aa34c commit a36de2c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ macro(pybind11_filter_tests LISTNAME)
2929
set(PYBIND11_FILTER_TESTS_FOUND OFF)
3030
# Make a list of the test without any extensions, for easier filtering.
3131
set(_TMP_ACTUAL_LIST "${${LISTNAME}};") # enforce ';' at the end to allow matching last item.
32-
string(REGEX REPLACE "\\.[^.]*;" ";" LIST_WITHOUT_EXTENSIONS "${_TMP_ACTUAL_LIST}")
32+
string(REGEX REPLACE "\\.[^.;]*;" ";" LIST_WITHOUT_EXTENSIONS "${_TMP_ACTUAL_LIST}")
3333
foreach(filename IN LISTS ARG_UNPARSED_ARGUMENTS)
3434
string(REGEX REPLACE "\\.[^.]*$" "" filename_no_ext ${filename})
3535
# Search in the list without extensions.
@@ -163,8 +163,8 @@ set(PYBIND11_TEST_FILES
163163
if(PYBIND11_TEST_OVERRIDE)
164164
# Instead of doing a direct override here, we iterate over the overrides without extension and
165165
# match them against entries from the PYBIND11_TEST_FILES, anything that not matches goes into the filter list.
166-
string(REGEX REPLACE "\\.[^.]*;" ";" TEST_OVERRIDE_NO_EXT "${PYBIND11_TEST_OVERRIDE};")
167-
string(REGEX REPLACE "\\.[^.]*;" ";" TEST_FILES_NO_EXT "${PYBIND11_TEST_FILES};")
166+
string(REGEX REPLACE "\\.[^.;]*;" ";" TEST_OVERRIDE_NO_EXT "${PYBIND11_TEST_OVERRIDE};")
167+
string(REGEX REPLACE "\\.[^.;]*;" ";" TEST_FILES_NO_EXT "${PYBIND11_TEST_FILES};")
168168
# This allows the override to be done with extensions, preserving backwards compatibility.
169169
foreach(test_name ${TEST_FILES_NO_EXT})
170170
if(NOT ${test_name} IN_LIST TEST_OVERRIDE_NO_EXT

0 commit comments

Comments
 (0)