From fa01964a1f64b0999d31d422e508108618a2ad51 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Tue, 31 Jan 2006 15:24:03 +0000 Subject: [PATCH] tests fo lexicographical_compare added [SVN r32479] --- string/test/predicate_test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/string/test/predicate_test.cpp b/string/test/predicate_test.cpp index d2d0f0e..28f7c9c 100644 --- a/string/test/predicate_test.cpp +++ b/string/test/predicate_test.cpp @@ -56,6 +56,15 @@ void predicate_test() BOOST_CHECK( iequals( "AbC", "abc" ) ); BOOST_CHECK( !iequals( "aBc", "yyy" ) ); + BOOST_CHECK( lexicographical_compare("abc", "abd") ); + BOOST_CHECK( !lexicographical_compare("abc", "abc") ); + BOOST_CHECK( lexicographical_compare("abc", "abd", is_not_greater()) ); + BOOST_CHECK( lexicographical_compare("abc", "abc", is_not_greater()) ); + + BOOST_CHECK( !ilexicographical_compare("aBD", "AbC") ); + BOOST_CHECK( ilexicographical_compare("aBc", "AbD") ); + BOOST_CHECK( lexicographical_compare("abC", "aBc", is_not_igreater()) ); + // multi-type comparison test BOOST_CHECK( starts_with( vec1, string("123") ) ); BOOST_CHECK( ends_with( vec1, string("321") ) ); @@ -85,6 +94,7 @@ void predicate_test() BOOST_CHECK( ends_with( "123xxx321", "321" ) ); BOOST_CHECK( contains( "123xxx321", "xxx" ) ); BOOST_CHECK( equals( "123xxx321", "123xxx321" ) ); + } #define TEST_CLASS( Pred, YesInput, NoInput )\