Skip to content

Commit d74e6dc

Browse files
Avoid std::regex::multiline in test (unsupported on MSVC)
Replace ^/$ anchors with \n matching to avoid std::regex::multiline, which is not supported by MSVC's regex implementation. Signed-off-by: Christian Parpart <christian@parpart.family>
1 parent 76f368b commit d74e6dc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vtbackend/Capabilities_test.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ TEST_CASE("Capabilities.terminfo_no_empty_string_values", "[issue-1861]")
4242
vtbackend::capabilities::StaticDatabase const tcap;
4343
auto const terminfo = tcap.terminfo();
4444

45-
// The regex matches lines like " name=," where the value after '=' is empty.
45+
// The regex matches sequences like "\n name=,\n" where the value after '=' is empty.
4646
// In terminfo format, "name=value," defines a string capability.
47-
// "name=," means the value is an empty string — this must never appear.
48-
auto const emptyValuePattern = std::regex(R"(^\s+(\w+)=,$)", std::regex::multiline);
47+
// "name=,\n" means the value is an empty string — this must never appear.
48+
// Note: We avoid std::regex::multiline because MSVC does not support it.
49+
auto const emptyValuePattern = std::regex(R"(\n\s+(\w+)=,\n)");
4950

5051
auto begin = std::sregex_iterator(terminfo.begin(), terminfo.end(), emptyValuePattern);
5152
auto end = std::sregex_iterator();

0 commit comments

Comments
 (0)