|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55770 - trunk/libs/spirit/test/karma
From: hartmut.kaiser_at_[hidden]
Date: 2009-08-24 20:24:55
Author: hkaiser
Date: 2009-08-24 20:24:54 EDT (Mon, 24 Aug 2009)
New Revision: 55770
URL: http://svn.boost.org/trac/boost/changeset/55770
Log:
Spirit: Added karma::stream_generator test cases
Text files modified:
trunk/libs/spirit/test/karma/stream.cpp | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
Modified: trunk/libs/spirit/test/karma/stream.cpp
==============================================================================
--- trunk/libs/spirit/test/karma/stream.cpp (original)
+++ trunk/libs/spirit/test/karma/stream.cpp 2009-08-24 20:24:54 EDT (Mon, 24 Aug 2009)
@@ -111,6 +111,25 @@
}
{
+ typedef karma::stream_generator<utf8_char> utf8_stream_type;
+ utf8_stream_type const utf8_stream = utf8_stream_type();
+
+ BOOST_TEST(test_delimited("x ", utf8_stream, 'x', ' '));
+ BOOST_TEST(test_delimited("xyz ", utf8_stream, "xyz", ' '));
+ BOOST_TEST(test_delimited("xyz ", utf8_stream, std::string("xyz"), ' '));
+ BOOST_TEST(test_delimited("1 ", utf8_stream, 1, ' '));
+ BOOST_TEST(test_delimited("1.1 ", utf8_stream, 1.1, ' '));
+ BOOST_TEST(test_delimited("{1.2,2.4} ", utf8_stream, complex(1.2, 2.4), ' '));
+
+ BOOST_TEST(test("x", utf8_stream('x')));
+ BOOST_TEST(test("xyz", utf8_stream("xyz")));
+ BOOST_TEST(test("xyz", utf8_stream(std::string("xyz"))));
+ BOOST_TEST(test("1", utf8_stream(1)));
+ BOOST_TEST(test("1.1", utf8_stream(1.1)));
+ BOOST_TEST(test("{1.2,2.4}", utf8_stream(complex(1.2, 2.4))));
+ }
+
+ {
using namespace boost::spirit::ascii;
BOOST_TEST(test_delimited("x ", lower[stream], 'X', ' '));
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