mirror of
https://github.com/boostorg/core.git
synced 2025-07-30 21:07:22 +02:00
Update tests
This commit is contained in:
@ -524,6 +524,41 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
wchar_t str[ 256 ];
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
str[ i ] = static_cast< wchar_t >( 0x100 + i );
|
||||
}
|
||||
|
||||
boost::core::wstring_view sv( str, 256 );
|
||||
|
||||
BOOST_TEST_EQ( sv.find_first_not_of( sv ), npos );
|
||||
|
||||
std::wstring str2( sv.data(), sv.size() );
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
std::wstring str3( str2 );
|
||||
|
||||
str3[ i ] = ~str3[ i ];
|
||||
|
||||
BOOST_TEST_EQ( sv.find_first_not_of( str3 ), i );
|
||||
}
|
||||
|
||||
std::reverse( str, str + 256 );
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
std::wstring str3( str2 );
|
||||
|
||||
str3[ i ] = ~str3[ i ];
|
||||
|
||||
BOOST_TEST_EQ( sv.find_first_not_of( str3 ), 255 - i );
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
|
||||
|
||||
{
|
||||
|
@ -446,6 +446,31 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
wchar_t str[ 256 ];
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
str[ i ] = static_cast< wchar_t >( 0x100 + i );
|
||||
}
|
||||
|
||||
boost::core::wstring_view sv( str, 256 );
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
std::wstring needle( 12, static_cast< wchar_t >( 0x100 + i ) );
|
||||
BOOST_TEST_EQ( sv.find_first_of( needle ), i );
|
||||
}
|
||||
|
||||
std::reverse( str, str + 256 );
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
std::wstring needle( 12, static_cast< wchar_t >( 0x100 + i ) );
|
||||
BOOST_TEST_EQ( sv.find_first_of( needle ), 255 - i );
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
|
||||
|
||||
{
|
||||
|
@ -524,6 +524,41 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
wchar_t str[ 256 ];
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
str[ i ] = static_cast< wchar_t >( 0x100 + i );
|
||||
}
|
||||
|
||||
boost::core::wstring_view sv( str, 256 );
|
||||
|
||||
BOOST_TEST_EQ( sv.find_first_not_of( sv ), npos );
|
||||
|
||||
std::wstring str2( sv.data(), sv.size() );
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
std::wstring str3( str2 );
|
||||
|
||||
str3[ i ] = ~str3[ i ];
|
||||
|
||||
BOOST_TEST_EQ( sv.find_first_not_of( str3 ), i );
|
||||
}
|
||||
|
||||
std::reverse( str, str + 256 );
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
std::wstring str3( str2 );
|
||||
|
||||
str3[ i ] = ~str3[ i ];
|
||||
|
||||
BOOST_TEST_EQ( sv.find_first_not_of( str3 ), 255 - i );
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
|
||||
|
||||
{
|
||||
|
@ -464,6 +464,31 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
wchar_t str[ 256 ];
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
str[ i ] = static_cast< wchar_t >( 0x100 + i );
|
||||
}
|
||||
|
||||
boost::core::wstring_view sv( str, 256 );
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
std::wstring needle( 12, static_cast< wchar_t >( 0x100 + i ) );
|
||||
BOOST_TEST_EQ( sv.find_first_of( needle ), i );
|
||||
}
|
||||
|
||||
std::reverse( str, str + 256 );
|
||||
|
||||
for( int i = 0; i < 256; ++i )
|
||||
{
|
||||
std::wstring needle( 12, static_cast< wchar_t >( 0x100 + i ) );
|
||||
BOOST_TEST_EQ( sv.find_first_of( needle ), 255 - i );
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
|
||||
|
||||
{
|
||||
|
Reference in New Issue
Block a user