@@ -654,6 +654,49 @@ TEST_F(ListBlocksTest, ShowList_Global_Nonexistent)
654
654
ASSERT_TRUE (monitor2->visible ());
655
655
}
656
656
657
+ TEST_F (ListBlocksTest, ShowList_Global_Nonexistent_FromSprite)
658
+ {
659
+ auto stage = std::make_shared<Stage>();
660
+ auto sprite = std::make_shared<Sprite>();
661
+
662
+ auto list1 = std::make_shared<List>(" a" , " list1" );
663
+ list1->append (" item1" );
664
+ list1->append (" item2" );
665
+ stage->addList (list1);
666
+ auto list2 = std::make_shared<List>(" b" , " list2" );
667
+ list2->append (" Hello" );
668
+ list2->append (" world" );
669
+ stage->addList (list2);
670
+
671
+ m_engine->setTargets ({ stage, sprite });
672
+
673
+ ScriptBuilder builder1 (m_extension.get (), m_engine, sprite);
674
+ builder1.addBlock (" data_showlist" );
675
+ builder1.addEntityField (" LIST" , list1);
676
+
677
+ ScriptBuilder builder2 (m_extension.get (), m_engine, sprite);
678
+ builder2.addBlock (" data_showlist" );
679
+ builder2.addEntityField (" LIST" , list2);
680
+
681
+ ScriptBuilder::buildMultiple ({ &builder1, &builder2 });
682
+ m_engine->run ();
683
+
684
+ // Missing monitors should be created
685
+ builder1.run ();
686
+
687
+ Monitor *monitor1 = list1->monitor ();
688
+ ASSERT_TRUE (monitor1);
689
+ ASSERT_TRUE (monitor1->visible ());
690
+
691
+ builder2.run ();
692
+
693
+ Monitor *monitor2 = list2->monitor ();
694
+
695
+ ASSERT_TRUE (monitor2);
696
+ ASSERT_TRUE (monitor1->visible ());
697
+ ASSERT_TRUE (monitor2->visible ());
698
+ }
699
+
657
700
TEST_F (ListBlocksTest, ShowList_Local_Existent)
658
701
{
659
702
auto stage = std::make_shared<Stage>();
0 commit comments