|
Boost-Commit : |
From: david_at_[hidden]
Date: 2008-03-12 10:46:25
Author: djenkins
Date: 2008-03-12 10:46:24 EDT (Wed, 12 Mar 2008)
New Revision: 43572
URL: http://svn.boost.org/trac/boost/changeset/43572
Log:
Added test for keep() of nested regex with action
Text files modified:
trunk/libs/xpressive/test/misc2.cpp | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
Modified: trunk/libs/xpressive/test/misc2.cpp
==============================================================================
--- trunk/libs/xpressive/test/misc2.cpp (original)
+++ trunk/libs/xpressive/test/misc2.cpp 2008-03-12 10:46:24 EDT (Wed, 12 Mar 2008)
@@ -34,7 +34,22 @@
sregex_compiler compiler;
compiler["rx0"] = (s1="foo")[ ref(result) = s1 ];
- sregex rx = compiler.compile( "(?>(?$rx0))");
+ sregex rx = compiler.compile("(?>(?$rx0))");
+
+ bool ok = regex_match(str, rx);
+ BOOST_CHECK(ok);
+ BOOST_CHECK_EQUAL(result, "foo");
+}
+
+///////////////////////////////////////////////////////////////////////////////
+//
+void test_static_actions_in_static_keep()
+{
+ std::string result;
+ std::string str("foo");
+
+ sregex rx0 = (s1="foo")[ ref(result) = s1 ];
+ sregex rx = keep(rx0);
bool ok = regex_match(str, rx);
BOOST_CHECK(ok);
@@ -51,6 +66,7 @@
test->add(BOOST_TEST_CASE(&test_complement));
test->add(BOOST_TEST_CASE(&test_static_actions_in_dynamic_keep));
+ test->add(BOOST_TEST_CASE(&test_static_actions_in_static_keep));
return test;
}
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