Files
Card-Collection-Manager-3/tests/ascii_utils_tests.cpp
T
2026-05-13 21:16:41 +02:00

26 lines
705 B
C++

#include <doctest/doctest.h>
#include "ccm/util/AsciiUtils.hpp"
using namespace ccm;
TEST_SUITE("asciiLower") {
TEST_CASE("empty string stays empty") {
CHECK(asciiLower("").empty());
}
TEST_CASE("lowercases ASCII letters and leaves other ASCII bytes unchanged") {
CHECK(asciiLower("AbC123!@#") == "abc123!@#");
}
TEST_CASE("non-ASCII UTF-8 bytes pass through unchanged") {
const std::string input = "caf\u00e9";
CHECK(asciiLower(input) == input);
}
TEST_CASE("bytes above ASCII range are passed through tolower unchanged") {
const std::string input(1, static_cast<char>('\x80'));
CHECK(asciiLower(input) == input);
}
}