mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve curve naming for plot and use in RFT segment plots
* Improve plot naming for depth track plots * Move template text replace to string tools * More data available for object template text * Set plot visible and define default object name template text
This commit is contained in:
@@ -342,3 +342,29 @@ WELSPECS
|
||||
EXPECT_STREQ( textForCompare.toStdString().data(), tableText.toStdString().data() );
|
||||
}
|
||||
}
|
||||
|
||||
TEST( RifTextDataTableFormatter, ReplaceTokensInString )
|
||||
{
|
||||
{
|
||||
std::map<QString, QString> keyValues = {
|
||||
{ "$KEY1", "VALUE1" },
|
||||
{ "$KEY1_WITH_MORE_TEXT", "VALUE2" },
|
||||
};
|
||||
|
||||
auto templateText = QString( "$KEY1, $KEY1_WITH_MORE_TEXT" );
|
||||
auto resolvedText = RiaTextStringTools::replaceTemplateTextWithValues( templateText, keyValues );
|
||||
|
||||
EXPECT_STREQ( resolvedText.toStdString().data(), "VALUE1, VALUE2" );
|
||||
}
|
||||
|
||||
{
|
||||
std::map<QString, QString> keyValues = {
|
||||
{ "$KEY1", "VALUE1" },
|
||||
};
|
||||
|
||||
auto templateText = QString( "$KEY1, $KEY1_WITH_MORE_2" );
|
||||
auto resolvedText = RiaTextStringTools::replaceTemplateTextWithValues( templateText, keyValues );
|
||||
|
||||
EXPECT_STREQ( resolvedText.toStdString().data(), "VALUE1, $KEY1_WITH_MORE_2" );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user