1 /*=============================================================================
2     Copyright (c) 2011      Bryce Lelbach
3 
4     Use, modification and distribution is subject to the Boost Software
5     License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6     http://www.boost.org/LICENSE_1_0.txt)
7 =============================================================================*/
8 
9 #include <boost/detail/lightweight_test.hpp>
10 #include <boost/spirit/include/qi_operator.hpp>
11 #include <boost/spirit/include/qi_char.hpp>
12 #include <boost/spirit/include/qi_repeat.hpp>
13 #include <boost/spirit/include/phoenix_core.hpp>
14 
15 #include "test.hpp"
16 
17 int
main()18 main()
19 {
20     using spirit_test::test_attr;
21     using boost::spirit::qi::repeat;
22     using boost::spirit::qi::char_;
23     using boost::phoenix::ref;
24 
25     int n = 5;
26     std::string s = "";
27 
28     // this was broken by the addition of handles_container, due to incorrect
29     // dispatching of lazy parsers/directives/terminals in pass_container
30     BOOST_TEST(test_attr("foobar", char_ >> repeat(ref(n))[char_], s));
31 
32     BOOST_TEST_EQ(s, "foobar");
33 
34     return boost::report_errors();
35 }
36 
37