Skip to content

Commit

Permalink
tests: Use string.empty()
Browse files Browse the repository at this point in the history
Was IDE hint.
  • Loading branch information
jp7677 committed Jan 25, 2025
1 parent c8bffaa commit 3eeae9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::set<std::string>>("", std::regex(",")).size() == 0);
REQUIRE(dxvk::str::split<std::set<std::string>>("", std::regex(",")).empty());

auto result = dxvk::str::split<std::set<std::string>>("foo,bar,baz", std::regex(","));

Expand Down Expand Up @@ -132,7 +132,7 @@ TEST_CASE("String", "[.util]") {
}

SECTION("implode") {
REQUIRE(dxvk::str::implode(",", std::vector<std::string_view>{}) == std::string());
REQUIRE(dxvk::str::implode(",", std::vector<std::string_view>{}).empty());
REQUIRE(dxvk::str::implode(",", std::vector<std::string_view>{"foo"}) == "foo");
REQUIRE(dxvk::str::implode(" ", std::vector<std::string_view>{"foo", "bar"}) == "foo bar");
REQUIRE(dxvk::str::implode(", ", std::vector<std::string_view>{"foo", "bar", "baz"}) == "foo, bar, baz");
Expand Down

0 comments on commit 3eeae9e

Please sign in to comment.