From 4eef56761aa48611009a9f31e1d2307703a22088 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Sun, 1 Jul 2007 22:24:29 +0000 Subject: [PATCH] find/split iterator tests added [SVN r38126] --- string/test/split_test.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/string/test/split_test.cpp b/string/test/split_test.cpp index f1de543..bb4e1a2 100644 --- a/string/test/split_test.cpp +++ b/string/test/split_test.cpp @@ -122,6 +122,25 @@ void iterator_test() BOOST_CHECK( tokens[2]==string("") ); BOOST_CHECK( tokens[3]==string("xx") ); BOOST_CHECK( tokens[4]==string("abb") ); + + find_iterator fiter=make_find_iterator(str1, first_finder("xx")); + BOOST_CHECK(equals(*fiter, "xx")); + ++fiter; + BOOST_CHECK(equals(*fiter, "xx")); + ++fiter; + BOOST_CHECK(fiter==find_iterator()); + + split_iterator siter=make_split_iterator(str1, token_finder(is_any_of("-"), token_compress_on)); + BOOST_CHECK(equals(*siter, "xx")); + ++siter; + BOOST_CHECK(equals(*siter, "abc")); + ++siter; + BOOST_CHECK(equals(*siter, "xx")); + ++siter; + BOOST_CHECK(equals(*siter, "abb")); + ++siter; + BOOST_CHECK(siter==split_iterator()); + } // test main