mirror of
https://github.com/sebastiandine/Card-Collection-Manager-3.git
synced 2026-08-28 22:01:12 +00:00
26 lines
705 B
C++
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);
|
|
}
|
|
}
|