diff --git a/test/ObjLoadingTests/Parsing/Menu/Sequence/ItemScopeSequencesTests.cpp b/test/ObjLoadingTests/Parsing/Menu/Sequence/ItemScopeSequencesTests.cpp index ad76a38a..7fe9817c 100644 --- a/test/ObjLoadingTests/Parsing/Menu/Sequence/ItemScopeSequencesTests.cpp +++ b/test/ObjLoadingTests/Parsing/Menu/Sequence/ItemScopeSequencesTests.cpp @@ -118,6 +118,33 @@ namespace test::parsing::menu::sequence::item REQUIRE(item->m_style == 9); } + TEST_CASE("ItemScopeSequences: Can use static expressions for simple float properties", "[parsing][sequence][menu]") + { + ItemSequenceTestsHelper helper(FeatureLevel::IW4, false); + const TokenPos pos; + helper.Tokens({ + SimpleParserValue::Identifier(pos, new std::string("borderSize")), + SimpleParserValue::Character(pos, '('), + SimpleParserValue::FloatingPoint(pos, 4.2), + SimpleParserValue::Character(pos, '+'), + SimpleParserValue::FloatingPoint(pos, 5), + SimpleParserValue::Character(pos, '+'), + SimpleParserValue::FloatingPoint(pos, 0.2), + SimpleParserValue::Character(pos, ')'), + SimpleParserValue::EndOfFile(pos), + }); + + const auto result = helper.PerformTest(); + + REQUIRE(result); + REQUIRE(helper.m_consumed_token_count == 8); + + const auto* item = helper.m_state->m_current_item; + REQUIRE(item); + + REQUIRE_THAT(item->m_border_size, WithinRel(9.4)); + } + TEST_CASE("ItemScopeSequences: Rect works with only x,y,w,h as ints", "[parsing][sequence][menu]") { ItemSequenceTestsHelper helper(FeatureLevel::IW4, false);