Merge branch 'master' into jgrpp
# Conflicts: # src/crashlog.cpp # src/gfx.cpp # src/network/network_client.cpp # src/openttd.cpp # src/openttd.h # src/saveload/saveload.cpp # src/survey.cpp
This commit is contained in:
@@ -385,3 +385,26 @@ TEST_CASE("ConvertHexToBytes")
|
||||
CHECK(bytes3[6] == 0xde);
|
||||
CHECK(bytes3[7] == 0xf0);
|
||||
}
|
||||
|
||||
static const std::vector<std::pair<std::string, std::string>> _str_trim_testcases = {
|
||||
{"a", "a"},
|
||||
{" a", "a"},
|
||||
{"a ", "a"},
|
||||
{" a ", "a"},
|
||||
{" a b c ", "a b c"},
|
||||
{" ", ""}
|
||||
};
|
||||
|
||||
TEST_CASE("StrTrimInPlace")
|
||||
{
|
||||
for (auto [input, expected] : _str_trim_testcases) {
|
||||
StrTrimInPlace(input);
|
||||
CHECK(input == expected);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("StrTrimView") {
|
||||
for (const auto& [input, expected] : _str_trim_testcases) {
|
||||
CHECK(StrTrimView(input) == expected);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user