Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67408 - trunk/libs/spirit/test/qi
From: hartmut.kaiser_at_[hidden]
Date: 2010-12-21 20:27:08


Author: hkaiser
Date: 2010-12-21 20:27:07 EST (Tue, 21 Dec 2010)
New Revision: 67408
URL: http://svn.boost.org/trac/boost/changeset/67408

Log:
Spirit: fixed/added utree tests
Text files modified:
   trunk/libs/spirit/test/qi/utree.cpp | 12 +++++++-----
   1 files changed, 7 insertions(+), 5 deletions(-)

Modified: trunk/libs/spirit/test/qi/utree.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/utree.cpp (original)
+++ trunk/libs/spirit/test/qi/utree.cpp 2010-12-21 20:27:07 EST (Tue, 21 Dec 2010)
@@ -37,6 +37,7 @@
     using boost::spirit::qi::rule;
     using boost::spirit::qi::as_string;
     using boost::spirit::qi::lexeme;
+ using boost::spirit::qi::as_string;
 
     // primitive data types
     {
@@ -63,7 +64,7 @@
             ut.which() == utree_type::symbol_type && check(ut, "xyz"));
     }
 
- // char set tests
+ // single character parsers, FIXME: should we leave that in?
     {
         utree ut;
         rule<char const*, utf8_string_type()> r1 = char_("abc");
@@ -76,6 +77,7 @@
         
         BOOST_TEST(test_attr("+", r2, ut) &&
             ut.which() == utree_type::symbol_type && check(ut, "+"));
+ ut.clear();
     }
 
     // sequences
@@ -94,19 +96,19 @@
 
         ut.clear();
         BOOST_TEST(test_attr("1.2ab", double_ >> *char_, ut) &&
- ut.which() == utree_type::list_type && check(ut, "( 1.2 \"a\" \"b\" )")); // FIXME?: "( 1.2 ( \"a\" \"b\" ) )"
+ ut.which() == utree_type::list_type && check(ut, "( 1.2 \"a\" \"b\" )"));
         ut.clear();
         BOOST_TEST(test_attr("ab1.2", *~digit >> double_, ut) &&
- ut.which() == utree_type::list_type && check(ut, "( \"a\" \"b\" 1.2 )")); // FIXME?: "( ( \"a\" \"b\" ) 1.2 )"
+ ut.which() == utree_type::list_type && check(ut, "( \"a\" \"b\" 1.2 )"));
 
         rule<char const*, utree()> r = double_;
 
         ut.clear();
         BOOST_TEST(test_attr("1.2ab", r >> *char_, ut) &&
- ut.which() == utree_type::list_type && check(ut, "( 1.2 \"a\" \"b\" )")); // FIXME?: "( 1.2 ( \"a\" \"b\" ) )"
+ ut.which() == utree_type::list_type && check(ut, "( 1.2 \"a\" \"b\" )"));
         ut.clear();
         BOOST_TEST(test_attr("ab1.2", *~digit >> r, ut) &&
- ut.which() == utree_type::list_type && check(ut, "( \"a\" \"b\" 1.2 )")); // FIXME?: "( ( \"a\" \"b\" ) 1.2 )"
+ ut.which() == utree_type::list_type && check(ut, "( \"a\" \"b\" 1.2 )"));
     }
 
     // kleene star


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk