2010-06-17 08:34:59 +08:00
|
|
|
// -*- C++ -*-
|
2010-09-29 01:19:10 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2010-06-17 08:34:59 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2010-11-17 06:09:02 +08:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-06-17 08:34:59 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-05 02:44:48 +08:00
|
|
|
// REQUIRES: locale.cs_CZ.ISO8859-2
|
|
|
|
|
2010-06-17 08:34:59 +08:00
|
|
|
// <regex>
|
|
|
|
|
|
|
|
// template <class charT> struct regex_traits;
|
|
|
|
|
|
|
|
// template <class ForwardIterator>
|
|
|
|
// string_type transform(ForwardIterator first, ForwardIterator last) const;
|
|
|
|
|
|
|
|
#include <regex>
|
|
|
|
#include <cassert>
|
2016-04-27 00:24:44 +08:00
|
|
|
#include "test_macros.h"
|
2013-01-05 11:21:01 +08:00
|
|
|
#include "test_iterators.h"
|
2015-03-16 23:09:15 +08:00
|
|
|
#include "platform_support.h" // locale name macros
|
|
|
|
|
2010-06-17 08:34:59 +08:00
|
|
|
int main()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::regex_traits<char> t;
|
|
|
|
const char a[] = "a";
|
|
|
|
const char B[] = "B";
|
|
|
|
typedef forward_iterator<const char*> F;
|
|
|
|
assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1)));
|
2015-03-16 23:09:15 +08:00
|
|
|
t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
|
2010-06-17 08:34:59 +08:00
|
|
|
assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
|
|
|
|
}
|
|
|
|
{
|
|
|
|
std::regex_traits<wchar_t> t;
|
|
|
|
const wchar_t a[] = L"a";
|
|
|
|
const wchar_t B[] = L"B";
|
|
|
|
typedef forward_iterator<const wchar_t*> F;
|
|
|
|
assert(t.transform(F(a), F(a+1)) > t.transform(F(B), F(B+1)));
|
2015-03-16 23:09:15 +08:00
|
|
|
t.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2));
|
2010-06-17 08:34:59 +08:00
|
|
|
assert(t.transform(F(a), F(a+1)) < t.transform(F(B), F(B+1)));
|
|
|
|
}
|
|
|
|
}
|