| 1 | /*============================================================================= |
| 2 | Copyright (c) 2001-2015 Joel de Guzman |
| 3 | Copyright (c) 2001-2011 Hartmut Kaiser |
| 4 | http://spirit.sourceforge.net/ |
| 5 | |
| 6 | Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 7 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 8 | =============================================================================*/ |
| 9 | #include <boost/spirit/home/x3.hpp> |
| 10 | |
| 11 | #include <iostream> |
| 12 | #include "test.hpp" |
| 13 | |
| 14 | int |
| 15 | main() |
| 16 | { |
| 17 | using spirit_test::test; |
| 18 | using spirit_test::test_attr; |
| 19 | using boost::spirit::x3::lit; |
| 20 | |
| 21 | { |
| 22 | BOOST_TEST((test("kimpo" , lit("kimpo" )))); |
| 23 | |
| 24 | std::basic_string<char> s("kimpo" ); |
| 25 | std::basic_string<wchar_t> ws(L"kimpo" ); |
| 26 | BOOST_TEST((test("kimpo" , lit(s)))); |
| 27 | BOOST_TEST((test(L"kimpo" , lit(ws)))); |
| 28 | } |
| 29 | |
| 30 | { |
| 31 | std::basic_string<char> s("kimpo" ); |
| 32 | BOOST_TEST((test("kimpo" , lit(s)))); |
| 33 | |
| 34 | std::basic_string<wchar_t> ws(L"kimpo" ); |
| 35 | BOOST_TEST((test(L"kimpo" , lit(ws)))); |
| 36 | } |
| 37 | |
| 38 | { |
| 39 | using namespace boost::spirit::x3::ascii; |
| 40 | BOOST_TEST((test(" kimpo" , lit("kimpo" ), space))); |
| 41 | BOOST_TEST((test(L" kimpo" , lit(L"kimpo" ), space))); |
| 42 | } |
| 43 | |
| 44 | { |
| 45 | using namespace boost::spirit::x3::iso8859_1; |
| 46 | BOOST_TEST((test(" kimpo" , lit("kimpo" ), space))); |
| 47 | BOOST_TEST((test(L" kimpo" , lit(L"kimpo" ), space))); |
| 48 | } |
| 49 | |
| 50 | return boost::report_errors(); |
| 51 | } |
| 52 | |