tests/utils: Add tests for trimSpaces

This commit is contained in:
Peter Keresztes Schmidt 2021-03-22 23:21:27 +01:00
parent 4529e59b1d
commit 6150ceeb17
1 changed files with 18 additions and 0 deletions

View File

@ -31,3 +31,21 @@ TEST_CASE("trimSet") {
REQUIRE(trimSet("te\"st", "\"") == "te\"st");
REQUIRE(trimSet("\"te\"st\"", "\"") == "te\"st");
}
TEST_CASE("trimSpaces") {
REQUIRE(trimSpaces(" ") == "");
REQUIRE(trimSpaces("test") == "test");
REQUIRE(trimSpaces(" test ") == "test");
REQUIRE(trimSpaces(" test ") == "test");
REQUIRE(trimSpaces(" test ") == "test");
REQUIRE(trimSpaces(" test") == "test");
REQUIRE(trimSpaces("\ttest") == "test");
REQUIRE(trimSpaces("test\t") == "test");
REQUIRE(trimSpaces("\ttest\t") == "test");
REQUIRE(trimSpaces(" test\t") == "test");
REQUIRE(trimSpaces("\ttest ") == "test");
REQUIRE(trimSpaces("\t test \t") == "test");
REQUIRE(trimSpaces("\t te st \t") == "te st");
}