Codechange: pass the characters to trim to StrTrimView

This commit is contained in:
Rubidium
2025-05-03 08:05:54 +02:00
committed by rubidium42
parent e2db8277b8
commit 1f39d469ff
8 changed files with 16 additions and 11 deletions

View File

@@ -14,6 +14,7 @@
#include "../string_func.h"
#include "../strings_func.h"
#include "../core/string_builder.hpp"
#include "../core/string_consumer.hpp"
#include "../table/control_codes.h"
#include "table/strings.h"
@@ -398,7 +399,8 @@ static const std::vector<std::pair<std::string, std::string>> _str_trim_testcase
{"a ", "a"},
{" a ", "a"},
{" a b c ", "a b c"},
{" ", ""}
{" ", ""},
{" \r\f\t ", ""},
};
TEST_CASE("StrTrimInPlace")
@@ -411,7 +413,7 @@ TEST_CASE("StrTrimInPlace")
TEST_CASE("StrTrimView") {
for (const auto& [input, expected] : _str_trim_testcases) {
CHECK(StrTrimView(input) == expected);
CHECK(StrTrimView(input, StringConsumer::WHITESPACE_NO_NEWLINE) == expected);
}
}