<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
... "model or widget" because of the use of Object >> #perform:orSendTo:.<div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div><blockquote class='history_container' type='cite' style='border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;'>
<p style='color: #AAAAAA; margin-top: 10px;'>Am 04.08.2020 10:52:39 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style='font-family:Arial,Helvetica,sans-serif'>Marcel Taeumel uploaded a new version of ToolsTests to project The Trunk:<br>http://source.squeak.org/trunk/ToolsTests-mt.98.mcz<br><br>==================== Summary ====================<br><br>Name: ToolsTests-mt.98<br>Author: mt<br>Time: 4 August 2020, 10:52:30.205047 am<br>UUID: c6795330-9d71-bd41-811f-76dec78f8ef6<br>Ancestors: ToolsTests-mt.97<br><br>Based on KernelTests-tcj.350 (inbox -> treated), add a test to check whether all menu actions are actually implemented in either model or widget.<br><br>Currently works for model's code-pane menus only. Test design requires agreement on communication between model and builder such as through #buildCodePaneWith:.<br><br>Not yet working for MVCToolBuilder. We do need to harmonize the interfaces of MenuMorph (Morphic) and PopUpMenu (MVC), e.g., by adding #items.<br><br>Not yet passing for MorphicToolBuilder bc. missing implementation of #makeProjectLink in either CodeHolder or PluggableTextMorph. :-)<br><br>=============== Diff against ToolsTests-mt.97 ===============<br><br>Item was changed:<br> SystemOrganization addCategory: #'ToolsTests-Browser'!<br> SystemOrganization addCategory: #'ToolsTests-Debugger'!<br> SystemOrganization addCategory: #'ToolsTests-FileList'!<br> SystemOrganization addCategory: #'ToolsTests-Inspector'!<br>+ SystemOrganization addCategory: #'ToolsTests-Menus'!<br><br>Item was added:<br>+ TestCase subclass: #ToolMenusTest<br>+ instanceVariableNames: ''<br>+ classVariableNames: ''<br>+ poolDictionaries: ''<br>+ category: 'ToolsTests-Menus'!<br><br>Item was added:<br>+ ----- Method: ToolMenusTest>>testCodePaneMenu (in category 'tests') -----<br>+ testCodePaneMenu<br>+ "Checks whether all menu actions are implemented in either the model or the widget."<br>+ <br>+ | builder builderSelector menuSelector result |<br>+ builder := ToolBuilder default.<br>+ builderSelector := #buildCodePaneWith:.<br>+ menuSelector := #menu.<br>+ result := Dictionary new.<br>+ <br>+ Model withAllSubclasses<br>+ select: [:modelClass | modelClass includesSelector: builderSelector]<br>+ thenDo: [:modelClass |<br>+ | model spec widget menu selectors |<br>+ result at: modelClass put: OrderedCollection new.<br>+ model := modelClass new.<br>+ spec := model perform: builderSelector with: builder.<br>+ (spec respondsTo: menuSelector) ifFalse: [<br>+ "Little hack to allow code panes being wrapped in panels."<br>+ spec := spec children detect: [:child |<br>+ (child respondsTo: menuSelector) and: [(child perform: menuSelector) notNil]]].<br>+ [widget := builder build: spec] on: Error do: [:ex | ex resume: nil].<br>+ #(false true) do: [:shifted |<br>+ menu := builder build: (builder pluggableMenuSpec new items; yourself).<br>+ menu := model perform: spec menu withEnoughArguments: {menu. shifted}. <br>+ selectors := menu items collect: [:item | item selector].<br>+ "MVC: selectors := menu selections select: [:sel | sel isSymbol]"<br>+ (result at: modelClass)<br>+ addAll: (selectors reject: [:selector |<br>+ (model respondsTo: selector) or: [widget respondsTo: selector]])]].<br>+ <br>+ self assert: (result values allSatisfy: [:notImplementedSelectors | notImplementedSelectors isEmpty]).!<br><br><br></div></blockquote>
</div></body>