#8307 Input Eclipse Case: Handle trailing line comment

This commit is contained in:
Magne Sjaastad
2022-03-24 11:22:27 +01:00
parent 696c6a15fa
commit 8feb0c363b
2 changed files with 31 additions and 1 deletions

View File

@@ -82,6 +82,29 @@ TEST( RifEclipseTextFileReader, DISABLED_ReadKeywordsAndValuesPerformanceTest )
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST( RifEclipseTextFileReader, ReadKeywordsWithComment )
{
QString faceTexts = "SPECGRID -- Generated : simulator name\n"
"124 134 41 1 F /\n"
"COORDSYS -- Generated : simulator name\n"
" 1 41 INCOMP /\n ";
auto stdString = faceTexts.toStdString();
size_t bytesRead = 0;
auto objects = RifEclipseTextFileReader::readKeywordAndValues( stdString, 0, bytesRead );
{
std::string toMatch( "SPECGRID" );
EXPECT_STREQ( objects.first.data(), toMatch.data() );
auto values = objects.second;
EXPECT_FLOAT_EQ( values[0], 124.0 );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------