blob: 3770ce4ea68b697241f8229f172c880a0b142038 [file] [log] [blame]
//===-- Unittests for tolower----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "src/ctype/tolower.h"
#include "test/UnitTest/Test.h"
TEST(LlvmLibcToLower, DefaultLocale) {
for (int ch = -255; ch < 255; ++ch) {
// This follows pattern 'A' + 32 = 'a'.
if ('A' <= ch && ch <= 'Z')
EXPECT_EQ(LIBC_NAMESPACE::tolower(ch), ch + 32);
else
EXPECT_EQ(LIBC_NAMESPACE::tolower(ch), ch);
}
}