| 1 | /*============================================================================= |
| 2 | Copyright (c) 2001-2011 Joel de Guzman |
| 3 | Copyright (c) 2001-2011 Hartmut Kaiser |
| 4 | Copyright (c) 2011 Bryce Lelbach |
| 5 | |
| 6 | Use, modification and distribution is subject to the Boost Software |
| 7 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 8 | http://www.boost.org/LICENSE_1_0.txt) |
| 9 | =============================================================================*/ |
| 10 | |
| 11 | #include <boost/spirit/include/qi_numeric.hpp> |
| 12 | |
| 13 | #include "test.hpp" |
| 14 | |
| 15 | int |
| 16 | main() |
| 17 | { |
| 18 | using spirit_test::test_attr; |
| 19 | using boost::spirit::qi::float_; |
| 20 | |
| 21 | std::cerr.precision(prec: 9); |
| 22 | |
| 23 | float f = 0.0f; |
| 24 | |
| 25 | // this should pass, but currently doesn't because of the way the real |
| 26 | // parser handles the fractional part of a number |
| 27 | BOOST_TEST(test_attr("123233.4124" , float_, f)); |
| 28 | BOOST_TEST_EQ(f, 123233.4124f); |
| 29 | BOOST_TEST(test_attr("987654.3219" , float_, f)); |
| 30 | BOOST_TEST_EQ(f, 987654.3219f); |
| 31 | |
| 32 | return boost::report_errors(); |
| 33 | } |
| 34 | |
| 35 | |