Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55015 - trunk/libs/spirit/test/qi
From: hartmut.kaiser_at_[hidden]
Date: 2009-07-18 12:02:30


Author: hkaiser
Date: 2009-07-18 12:02:29 EDT (Sat, 18 Jul 2009)
New Revision: 55015
URL: http://svn.boost.org/trac/boost/changeset/55015

Log:
Spirit: updating test case for new list parser code
Text files modified:
   trunk/libs/spirit/test/qi/list.cpp | 11 ++++++++++-
   1 files changed, 10 insertions(+), 1 deletions(-)

Modified: trunk/libs/spirit/test/qi/list.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/list.cpp (original)
+++ trunk/libs/spirit/test/qi/list.cpp 2009-07-18 12:02:29 EDT (Sat, 18 Jul 2009)
@@ -64,7 +64,7 @@
         BOOST_TEST(test_attr("(1,2)", '(' >> int_ % ',' >> ')', v));
         BOOST_TEST(2 == v.size() && 1 == v[0] && 2 == v[1]);
     }
-
+
     {
         std::vector<std::string> v;
         BOOST_TEST(test_attr("a,b,c,d", +alpha % ',', v));
@@ -72,6 +72,15 @@
             && "c" == v[2] && "d" == v[3]);
     }
 
+ {
+ std::vector<boost::optional<std::string> > v;
+ BOOST_TEST(test_attr("#a,#", ('#' >> -alpha) % ',', v));
+ BOOST_TEST(2 == v.size() &&
+ v[0] && "a" == boost::get<std::string>(v[0]) &&
+ v[1] && boost::get<std::string>(v[1]).size() == 1 &&
+ boost::get<std::string>(v[1])[0] == '\0');
+ }
+
     { // actions
         namespace phx = boost::phoenix;
         using boost::phoenix::begin;


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