]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2011 Joel de Guzman | |
3 | http://spirit.sourceforge.net/ | |
4 | ||
5 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
6 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
7 | =============================================================================*/ | |
8 | ||
7c673cae FG |
9 | #include <boost/detail/lightweight_test.hpp> |
10 | #include <boost/spirit/include/qi_char.hpp> | |
11 | #include <boost/spirit/include/qi_string.hpp> | |
12 | #include <boost/spirit/include/qi_directive.hpp> | |
13 | #include <boost/spirit/include/qi_action.hpp> | |
14 | #include <boost/spirit/include/phoenix_core.hpp> | |
15 | #include <boost/spirit/include/phoenix_operator.hpp> | |
16 | ||
17 | #include <iostream> | |
18 | #include "test.hpp" | |
19 | ||
20 | int | |
21 | main() | |
22 | { | |
23 | using spirit_test::test; | |
24 | using spirit_test::test_attr; | |
25 | using boost::spirit::qi::lit; | |
26 | using boost::spirit::qi::no_case; | |
27 | using boost::spirit::qi::char_; | |
28 | using boost::spirit::qi::encoding; | |
29 | namespace char_encoding = boost::spirit::char_encoding; | |
30 | ||
31 | encoding<char_encoding::iso8859_1> iso8859_1; | |
32 | ||
92f5a8d4 TL |
33 | { // test extended ASCII characters |
34 | BOOST_TEST(test("\xC1", iso8859_1[no_case['\xE1']])); | |
35 | BOOST_TEST(test("\xC1", iso8859_1[no_case[char_('\xE1')]])); | |
7c673cae | 36 | |
92f5a8d4 TL |
37 | BOOST_TEST(test("\xC9", iso8859_1[no_case[char_("\xE5-\xEF")]])); |
38 | BOOST_TEST(!test("\xFF", iso8859_1[no_case[char_("\xE5-\xEF")]])); | |
7c673cae | 39 | |
92f5a8d4 TL |
40 | BOOST_TEST(test("\xC1\xE1", iso8859_1[no_case["\xE1\xC1"]])); |
41 | BOOST_TEST(test("\xC1\xE1", iso8859_1[no_case[lit("\xE1\xC1")]])); | |
7c673cae FG |
42 | } |
43 | ||
7c673cae FG |
44 | return boost::report_errors(); |
45 | } |