diff --git a/test/sv_find_first_of_test.cpp b/test/sv_find_first_of_test.cpp index 445ee58..92e4188 100644 --- a/test/sv_find_first_of_test.cpp +++ b/test/sv_find_first_of_test.cpp @@ -4,6 +4,7 @@ #include #include +#include #include int main() @@ -380,6 +381,31 @@ int main() BOOST_TEST_EQ( sv.find_first_of( L"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 12 ), npos ); } + { + char str[ 256 ]; + + for( int i = 0; i < 256; ++i ) + { + str[ i ] = static_cast< unsigned char >( i ); + } + + boost::core::string_view sv( str, 256 ); + + for( int i = 0; i < 256; ++i ) + { + std::string needle( 12, static_cast< unsigned char >( i ) ); + BOOST_TEST_EQ( sv.find_first_of( needle ), i ); + } + + std::reverse( str, str + 256 ); + + for( int i = 0; i < 256; ++i ) + { + std::string needle( 12, static_cast< unsigned char >( i ) ); + BOOST_TEST_EQ( sv.find_first_of( needle ), 255 - i ); + } + } + #if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L {