blob: 7eaf30ea71c3285cb5a06e839e6a2eecd6170842 [file] [log] [blame]
Howard Hinnant3257c982010-06-17 00:34:59 +00001// -*- C++ -*-
Howard Hinnant0ce02242010-09-28 17:19:10 +00002//===----------------------------------------------------------------------===//
Howard Hinnant3257c982010-06-17 00:34:59 +00003//
4// The LLVM Compiler Infrastructure
5//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00006// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant3257c982010-06-17 00:34:59 +00008//
9//===----------------------------------------------------------------------===//
10
11// <regex>
12
13// template <class charT> struct regex_traits;
14
15// charT translate(charT c) const;
16
17#include <regex>
18#include <cassert>
Marshall Clow6dfff1c2016-04-26 16:24:44 +000019#include "test_macros.h"
Howard Hinnant3257c982010-06-17 00:34:59 +000020
21int main()
22{
23 {
24 std::regex_traits<char> t;
25 assert(t.translate('a') == 'a');
26 assert(t.translate('B') == 'B');
27 assert(t.translate('c') == 'c');
28 }
29 {
30 std::regex_traits<wchar_t> t;
31 assert(t.translate(L'a') == L'a');
32 assert(t.translate(L'B') == L'B');
33 assert(t.translate(L'c') == L'c');
34 }
35}