Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58408 - trunk/libs/spirit/test/qi
From: hartmut.kaiser_at_[hidden]
Date: 2009-12-15 20:38:10


Author: hkaiser
Date: 2009-12-15 20:38:09 EST (Tue, 15 Dec 2009)
New Revision: 58408
URL: http://svn.boost.org/trac/boost/changeset/58408

Log:
Spirit: fixing problem in qi::repeat[], augmented tests
Text files modified:
   trunk/libs/spirit/test/qi/repeat.cpp | 10 ++++++++++
   1 files changed, 10 insertions(+), 0 deletions(-)

Modified: trunk/libs/spirit/test/qi/repeat.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/repeat.cpp (original)
+++ trunk/libs/spirit/test/qi/repeat.cpp 2009-12-15 20:38:09 EST (Tue, 15 Dec 2009)
@@ -156,6 +156,16 @@
         BOOST_TEST(test_attr("b b b b", omit[repeat(4)[char_('b')]], s, space) && s == "bbbb");
     }
 
+ {
+ std::vector<char> v;
+ BOOST_TEST(test_attr("1 2 3", int_ >> repeat(2)[int_], v, space));
+ BOOST_TEST(v.size() == 3 && v[0] == 1 && v[1] == 2 && v[2] == 3);
+
+ v.clear();
+ BOOST_TEST(!test_attr("1 2", int_ >> repeat(2)[int_], v, space));
+ BOOST_TEST(v.size() == 1 && v[0] == 1);
+ }
+
     { // actions
         namespace phx = boost::phoenix;
 


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