|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r56663 - trunk/libs/spirit/test/karma
From: hartmut.kaiser_at_[hidden]
Date: 2009-10-08 20:33:34
Author: hkaiser
Date: 2009-10-08 20:33:34 EDT (Thu, 08 Oct 2009)
New Revision: 56663
URL: http://svn.boost.org/trac/boost/changeset/56663
Log:
Spirit: fixing special case for sequences, updated tests
Text files modified:
trunk/libs/spirit/test/karma/sequence.cpp | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
Modified: trunk/libs/spirit/test/karma/sequence.cpp
==============================================================================
--- trunk/libs/spirit/test/karma/sequence.cpp (original)
+++ trunk/libs/spirit/test/karma/sequence.cpp 2009-10-08 20:33:34 EDT (Thu, 08 Oct 2009)
@@ -145,6 +145,24 @@
}
}
+ // test special case where sequence has a one element vector attribute
+ // sequence and this element is a rule (attribute has to be passed through
+ // without change)
+ {
+ typedef spirit_test::output_iterator<char>::type outiter_type;
+ namespace karma = boost::spirit::karma;
+
+ karma::rule<outiter_type, std::vector<int>()> r = -(int_ % ',');
+ std::vector<int> v;
+ BOOST_TEST(test(">", '>' << r, v));
+
+ v.push_back(1);
+ v.push_back(2);
+ v.push_back(3);
+ v.push_back(4);
+ BOOST_TEST(test(">1,2,3,4", '>' << r, v));
+ }
+
return boost::report_errors();
}
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