Fix handling of too long 8 characters keywords like GUIDERATE

This commit is contained in:
Joakim Hove
2020-07-02 14:23:45 +02:00
parent c7b93797b6
commit 4e223eae4a
3 changed files with 30 additions and 9 deletions

View File

@@ -2318,3 +2318,23 @@ auto record = kw.getRecord(1);
BOOST_CHECK_EQUAL( record.getItem(5).get<double>(0), 0.9 );
BOOST_CHECK( !deck.hasKeyword("LANGMUIR") );
}
BOOST_AUTO_TEST_CASE(ParseLONGKeywords) {
Parser parser;
ParseContext parseContext;
ErrorGuard errors;
const auto deck_string = R"(
GUIDERATE
/
)";
parseContext.update(ParseContext::PARSE_LONG_KEYWORD, Opm::InputError::THROW_EXCEPTION);
BOOST_CHECK_THROW(parser.parseString(deck_string, parseContext, errors), std::invalid_argument);
parseContext.update(ParseContext::PARSE_LONG_KEYWORD, Opm::InputError::IGNORE);
auto deck = parser.parseString(deck_string, parseContext, errors);
BOOST_CHECK( deck.hasKeyword("GUIDERAT") );
}