From c3f1b0c00e36d7802f24c53f2a0ff7168c4e3de1 Mon Sep 17 00:00:00 2001 From: MarkLee131 Date: Mon, 4 May 2026 19:31:29 +0800 Subject: [PATCH] test: replace gmock matchers in Split test with gtest equivalents StringTest.cpp does not include gmock, so EXPECT_THAT/ElementsAre/IsEmpty do not compile and the unittest target fails on every CI configuration. Use EXPECT_EQ against a VCString and EXPECT_TRUE(empty()) instead, which keeps the test scope identical without dragging gmock into this file. --- test/StringTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/StringTest.cpp b/test/StringTest.cpp index f1706373..216f3862 100644 --- a/test/StringTest.cpp +++ b/test/StringTest.cpp @@ -190,11 +190,11 @@ TEST(StringTest, Split) { // element (or zero elements if the input itself is empty). VCString vempty; EXPECT_EQ(CS("abc").Split("", vempty, false), 1u); - EXPECT_THAT(vempty, ElementsAre("abc")); + EXPECT_EQ(vempty, VCString({"abc"})); EXPECT_EQ(CS("abc").Split("", vempty, true), 1u); EXPECT_EQ(vempty, VCString({"abc"})); EXPECT_EQ(CS("").Split("", vempty, false), 0u); - EXPECT_THAT(vempty, IsEmpty()); + EXPECT_TRUE(vempty.empty()); } TEST(StringTest, NamedFormat) {