brintos

brintos / llvm-project-archived public Read only

0
0
Text · 959 B · a3e5978 Raw
38 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// <regex>10 11// template <class charT> struct regex_traits;12 13// charT translate(charT c) const;14 15#include <regex>16#include <cassert>17#include "test_macros.h"18 19int main(int, char**)20{21    {22        std::regex_traits<char> t;23        assert(t.translate('a') == 'a');24        assert(t.translate('B') == 'B');25        assert(t.translate('c') == 'c');26    }27#ifndef TEST_HAS_NO_WIDE_CHARACTERS28    {29        std::regex_traits<wchar_t> t;30        assert(t.translate(L'a') == L'a');31        assert(t.translate(L'B') == L'B');32        assert(t.translate(L'c') == L'c');33    }34#endif35 36  return 0;37}38