1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // NetBSD does not support LC_COLLATE at the moment
12 // XFAIL: LIBCXX-AIX-FIXME
13 // XFAIL: LIBCXX-FREEBSD-FIXME
15 // REQUIRES: locale.cs_CZ.ISO8859-2
19 // template <class charT> struct regex_traits;
21 // template <class ForwardIterator>
23 // transform_primary(ForwardIterator first, ForwardIterator last) const;
28 #include "test_macros.h"
29 #include "test_iterators.h"
30 #include "platform_support.h" // locale name macros
35 std::regex_traits
<char> t
;
37 const char Aacute
[] = "\xC1";
38 typedef forward_iterator
<const char*> F
;
39 assert(t
.transform_primary(F(A
), F(A
+1)) !=
40 t
.transform_primary(F(Aacute
), F(Aacute
+1)));
41 t
.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2
));
42 assert(t
.transform_primary(F(A
), F(A
+1)) ==
43 t
.transform_primary(F(Aacute
), F(Aacute
+1)));
45 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
47 std::regex_traits
<wchar_t> t
;
48 const wchar_t A
[] = L
"A";
49 const wchar_t Aacute
[] = L
"\xC1";
50 typedef forward_iterator
<const wchar_t*> F
;
51 assert(t
.transform_primary(F(A
), F(A
+1)) !=
52 t
.transform_primary(F(Aacute
), F(Aacute
+1)));
53 t
.imbue(std::locale(LOCALE_cs_CZ_ISO8859_2
));
54 assert(t
.transform_primary(F(A
), F(A
+1)) ==
55 t
.transform_primary(F(Aacute
), F(Aacute
+1)));