blob: c3bce7939fe192d15485a520b63d326fa46babd1 [file] [log] [blame]
Howard Hinnant70505302010-06-17 00:34:59 +00001// -*- C++ -*-
Howard Hinnanteb9e9a32010-09-28 17:19:10 +00002//===----------------------------------------------------------------------===//
Howard Hinnant70505302010-06-17 00:34:59 +00003//
4// The LLVM Compiler Infrastructure
5//
Howard Hinnant412dbeb2010-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 Hinnant70505302010-06-17 00:34:59 +00008//
9//===----------------------------------------------------------------------===//
10
Dan Alberta85b27f2014-08-04 18:44:48 +000011// REQUIRES: locale.cs_CZ.ISO8859-2
12
Howard Hinnant70505302010-06-17 00:34:59 +000013// <regex>
14
15// template <class charT> struct regex_traits;
16
17// template <class ForwardIterator>
18// string_type transform(ForwardIterator first, ForwardIterator last) const;
19
20#include <regex>
21#include <cassert>
Marshall Clow32227082013-01-05 03:21:01 +000022#include "test_iterators.h"
Howard Hinnant70505302010-06-17 00:34:59 +000023
24int main()
25{
26 {
27 std::regex_traits<char> t;
28 const char a[] = "a";
29 const char B[] = "B";
30 typedef forward_iterator<const char*> F;
31 assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1)));
32 t.imbue(std::locale("cs_CZ.ISO8859-2"));
33 assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
34 }
35 {
36 std::regex_traits<wchar_t> t;
37 const wchar_t a[] = L"a";
38 const wchar_t B[] = L"B";
39 typedef forward_iterator<const wchar_t*> F;
40 assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1)));
41 t.imbue(std::locale("cs_CZ.ISO8859-2"));
42 assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
43 }
44}