mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
Add tests to ensure menu simple int properties can be static expressions
This commit is contained in:
parent
7820390dd8
commit
749f44b2c4
@ -91,6 +91,33 @@ namespace test::parsing::menu::sequence::item
|
|||||||
REQUIRE(item->m_name == "Hello World");
|
REQUIRE(item->m_name == "Hello World");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("ItemScopeSequences: Can use static expressions for simple int properties", "[parsing][sequence][menu]")
|
||||||
|
{
|
||||||
|
ItemSequenceTestsHelper helper(FeatureLevel::IW4, false);
|
||||||
|
const TokenPos pos;
|
||||||
|
helper.Tokens({
|
||||||
|
SimpleParserValue::Identifier(pos, new std::string("style")),
|
||||||
|
SimpleParserValue::Character(pos, '('),
|
||||||
|
SimpleParserValue::Integer(pos, 1),
|
||||||
|
SimpleParserValue::Character(pos, '+'),
|
||||||
|
SimpleParserValue::Integer(pos, 2),
|
||||||
|
SimpleParserValue::Character(pos, '+'),
|
||||||
|
SimpleParserValue::Integer(pos, 6),
|
||||||
|
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(item->m_style == 9);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE("ItemScopeSequences: Rect works with only x,y,w,h as ints", "[parsing][sequence][menu]")
|
TEST_CASE("ItemScopeSequences: Rect works with only x,y,w,h as ints", "[parsing][sequence][menu]")
|
||||||
{
|
{
|
||||||
ItemSequenceTestsHelper helper(FeatureLevel::IW4, false);
|
ItemSequenceTestsHelper helper(FeatureLevel::IW4, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user