1//===----------------------------------------------------------------------===//
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// <string>
10
11// template<> struct char_traits<wchar_t>
12
13// static constexpr bool lt(char_type c1, char_type c2);
14
15// UNSUPPORTED: no-wide-characters
16
17#include <string>
18#include <cassert>
19
20#include "test_macros.h"
21
22int main(int, char**) {
23 assert(std::char_traits<wchar_t>::lt(L'\0', L'A') == (L'\0' < L'A'));
24 assert(std::char_traits<wchar_t>::lt(L'A', L'\0') == (L'A' < L'\0'));
25
26 assert(std::char_traits<wchar_t>::lt(L'a', L'a') == (L'a' < L'a'));
27 assert(std::char_traits<wchar_t>::lt(L'A', L'a') == (L'A' < L'a'));
28 assert(std::char_traits<wchar_t>::lt(L'a', L'A') == (L'a' < L'A'));
29
30 assert(std::char_traits<wchar_t>::lt(L'a', L'z') == (L'a' < L'z'));
31 assert(std::char_traits<wchar_t>::lt(L'A', L'Z') == (L'A' < L'Z'));
32
33 assert(std::char_traits<wchar_t>::lt(L' ', L'A') == (L' ' < L'A'));
34 assert(std::char_traits<wchar_t>::lt(L'A', L'~') == (L'A' < L'~'));
35
36 return 0;
37}
38

source code of libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.wchar_t/lt.pass.cpp