diff options
author | Fedja Beader <fedja@protonmail.ch> | 2024-01-16 18:02:10 +0100 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2024-02-22 00:04:35 +0100 |
commit | b5acf91dfe7057b8effaf2f23afebb200448cd97 (patch) | |
tree | 88d046a0f01927f048ea531d2c696deb12762122 /src/ast | |
parent | e14910c45ed11a5aaa5647e618a915d12519b0a0 (diff) | |
download | tmwa-b5acf91dfe7057b8effaf2f23afebb200448cd97.tar.gz tmwa-b5acf91dfe7057b8effaf2f23afebb200448cd97.tar.bz2 tmwa-b5acf91dfe7057b8effaf2f23afebb200448cd97.tar.xz tmwa-b5acf91dfe7057b8effaf2f23afebb200448cd97.zip |
Update test cases for addition of Item Mode field
See "Item Mode" commit from Apr 3 2023
Diffstat (limited to 'src/ast')
-rw-r--r-- | src/ast/item_test.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ast/item_test.cpp b/src/ast/item_test.cpp index 7e5f1a9..33ed9cb 100644 --- a/src/ast/item_test.cpp +++ b/src/ast/item_test.cpp @@ -87,11 +87,11 @@ namespace item QuietFd q; LString inputs[] = { - // 1 2 3 4 5 - //2345678901234567890123456789012345678901234567890123456789 - "1,abc , 3,4,5,6,7,8,9,10,xx,2,16,12,13,11, {end;}, {}"_s, - "1,abc , 3,4,5,6,7,8,9,10,xx,2,16,12,13,11, {end;}, {}\n"_s, - "1,abc , 3,4,5,6,7,8,9,10,xx,2,16,12,13,11, {end;}, {}\nabc"_s, + // 1 2 3 4 5 6 + //23456789012345678901234567890123456789012345678901234567890123456789 + "1,abc , 3,4,5,6,7,8,9,10,xx,2,16,12,13,11,1, {end;}, {}"_s, + "1,abc , 3,4,5,6,7,8,9,10,xx,2,16,12,13,11,1, {end;}, {}\n"_s, + "1,abc , 3,4,5,6,7,8,9,10,xx,2,16,12,13,11,1, {end;}, {}\nabc"_s, }; for (auto input : inputs) { @@ -99,7 +99,7 @@ namespace item auto res = TRY_UNWRAP(parse_item(lr), FAIL()); EXPECT_TRUE(res.get_success().is_some()); auto top = TRY_UNWRAP(std::move(res.get_success()), FAIL()); - EXPECT_SPAN(top.span, 1,1, 1,58); + EXPECT_SPAN(top.span, 1,1, 1,60); auto p = top.get_if<Item>(); EXPECT_TRUE(p); if (p) @@ -136,9 +136,11 @@ namespace item EXPECT_EQ(p->elv.data, 13); EXPECT_SPAN(p->view.span, 1,45, 1,46); EXPECT_EQ(p->view.data, ItemLook::W_BOW); - EXPECT_SPAN(p->use_script.span, 1,49, 1,54); + EXPECT_SPAN(p->mode.span, 1,48, 1,48); + EXPECT_EQ(p->mode.data, ItemMode::NO_DROP); + EXPECT_SPAN(p->use_script.span, 1,51, 1,56); EXPECT_EQ(p->use_script.braced_body, "{end;}"_s); - EXPECT_SPAN(p->equip_script.span, 1,57, 1,58); + EXPECT_SPAN(p->equip_script.span, 1,59, 1,60); EXPECT_EQ(p->equip_script.braced_body, "{}"_s); } } |