#7494 Summary Plot: Lumped completions short names are wrong

Replace tabs in summary quantity name with space
This commit is contained in:
Magne Sjaastad 2021-03-25 13:36:06 +01:00
parent f5547dd551
commit 4a61226926
2 changed files with 18 additions and 0 deletions

View File

@ -289,6 +289,8 @@ std::string stringFromPointer( const char* pointerToChar )
if ( pointerToChar )
{
myString = pointerToChar;
replace( myString.begin(), myString.end(), '\t', ' ' );
}
return myString;

View File

@ -41,3 +41,19 @@ TEST( RiaStdStringToolsTest, EditDistance )
EXPECT_EQ( 3, RiaStdStringTools::computeEditDistance( "Saturday", "Sunday" ) );
EXPECT_EQ( 3, RiaStdStringTools::computeEditDistance( "Sunday", "Saturday" ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST( RiaStdStringToolsTest, TrimStrings )
{
// Test replace of tabs with space
{
std::string text = "test\t\tnext word";
replace( text.begin(), text.end(), '\t', ' ' );
std::string expectedText = "test next word";
EXPECT_EQ( text, expectedText );
}
}