From ba6d5b77485dda56f920c24d77c990905a9eafe8 Mon Sep 17 00:00:00 2001 From: Jens Peters Date: Sat, 25 Jan 2025 19:38:36 +0100 Subject: [PATCH] tests: Use string.empty() IDE hint. --- tests/util.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/util.cpp b/tests/util.cpp index dd939e29..f38c37a8 100644 --- a/tests/util.cpp +++ b/tests/util.cpp @@ -86,13 +86,13 @@ TEST_CASE("String", "[.util]") { } SECTION("fromnullable") { - REQUIRE(dxvk::str::fromnullable(nullptr) == std::string()); - REQUIRE(dxvk::str::fromnullable("") == std::string()); + REQUIRE(dxvk::str::fromnullable(nullptr).empty()); + REQUIRE(dxvk::str::fromnullable("").empty()); REQUIRE(dxvk::str::fromnullable("string") == "string"); } SECTION("split") { - REQUIRE(dxvk::str::split>("", std::regex(",")).size() == 0); + REQUIRE(dxvk::str::split>("", std::regex(",")).empty()); auto result = dxvk::str::split>("foo,bar,baz", std::regex(",")); @@ -132,7 +132,7 @@ TEST_CASE("String", "[.util]") { } SECTION("implode") { - REQUIRE(dxvk::str::implode(",", std::vector{}) == std::string()); + REQUIRE(dxvk::str::implode(",", std::vector{}).empty()); REQUIRE(dxvk::str::implode(",", std::vector{"foo"}) == "foo"); REQUIRE(dxvk::str::implode(" ", std::vector{"foo", "bar"}) == "foo bar"); REQUIRE(dxvk::str::implode(", ", std::vector{"foo", "bar", "baz"}) == "foo, bar, baz");