1//===-- Unittests for tolower----------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "src/ctype/tolower.h"
10#include "test/UnitTest/Test.h"
11
12TEST(LlvmLibcToLower, DefaultLocale) {
13 for (int ch = -255; ch < 255; ++ch) {
14 // This follows pattern 'A' + 32 = 'a'.
15 if ('A' <= ch && ch <= 'Z')
16 EXPECT_EQ(LIBC_NAMESPACE::tolower(ch), ch + 32);
17 else
18 EXPECT_EQ(LIBC_NAMESPACE::tolower(ch), ch);
19 }
20}
21

source code of libc/test/src/ctype/tolower_test.cpp