Marcel Taeumel uploaded a new version of ToolsTests to project The Trunk:
http://source.squeak.org/trunk/ToolsTests-mt.98.mcz
==================== Summary ====================
Name: ToolsTests-mt.98
Author: mt
Time: 4 August 2020, 10:52:30.205047 am
UUID: c6795330-9d71-bd41-811f-76dec78f8ef6
Ancestors: ToolsTests-mt.97
Based on KernelTests-tcj.350 (inbox -> treated), add a test to check whether all menu actions are actually implemented in either model or widget.
Currently works for model's code-pane menus only. Test design requires agreement on communication between model and builder such as through #buildCodePaneWith:.
Not yet working for MVCToolBuilder. We do need to harmonize the interfaces of MenuMorph (Morphic) and PopUpMenu (MVC), e.g., by adding #items.
Not yet passing for MorphicToolBuilder bc. missing implementation of #makeProjectLink in either CodeHolder or PluggableTextMorph. :-)
=============== Diff against ToolsTests-mt.97 ===============
Item was changed:
SystemOrganization addCategory: #'ToolsTests-Browser'!
SystemOrganization addCategory: #'ToolsTests-Debugger'!
SystemOrganization addCategory: #'ToolsTests-FileList'!
SystemOrganization addCategory: #'ToolsTests-Inspector'!
+ SystemOrganization addCategory: #'ToolsTests-Menus'!
Item was added:
+ TestCase subclass: #ToolMenusTest
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'ToolsTests-Menus'!
Item was added:
+ ----- Method: ToolMenusTest>>testCodePaneMenu (in category 'tests') -----
+ testCodePaneMenu
+ "Checks whether all menu actions are implemented in either the model or the widget."
+
+ | builder builderSelector menuSelector result |
+ builder := ToolBuilder default.
+ builderSelector := #buildCodePaneWith:.
+ menuSelector := #menu.
+ result := Dictionary new.
+
+ Model withAllSubclasses
+ select: [:modelClass | modelClass includesSelector: builderSelector]
+ thenDo: [:modelClass |
+ | model spec widget menu selectors |
+ result at: modelClass put: OrderedCollection new.
+ model := modelClass new.
+ spec := model perform: builderSelector with: builder.
+ (spec respondsTo: menuSelector) ifFalse: [
+ "Little hack to allow code panes being wrapped in panels."
+ spec := spec children detect: [:child |
+ (child respondsTo: menuSelector) and: [(child perform: menuSelector) notNil]]].
+ [widget := builder build: spec] on: Error do: [:ex | ex resume: nil].
+ #(false true) do: [:shifted |
+ menu := builder build: (builder pluggableMenuSpec new items; yourself).
+ menu := model perform: spec menu withEnoughArguments: {menu. shifted}.
+ selectors := menu items collect: [:item | item selector].
+ "MVC: selectors := menu selections select: [:sel | sel isSymbol]"
+ (result at: modelClass)
+ addAll: (selectors reject: [:selector |
+ (model respondsTo: selector) or: [widget respondsTo: selector]])]].
+
+ self assert: (result values allSatisfy: [:notImplementedSelectors | notImplementedSelectors isEmpty]).!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.905.mcz
==================== Summary ====================
Name: Collections-eem.905
Author: eem
Time: 31 July 2020, 8:12:16.99079 pm
UUID: 41110ea1-5c9c-40e4-b5fa-156999451cae
Ancestors: Collections-eem.904
Provide SequenceableCollection>>indicesOfSubCollection:[startingAt:]
Add primitiveFetchMourner for ephemerons.
Tidy up restartFinalizationProcess and name the finalization process for the process inspector.
=============== Diff against Collections-eem.904 ===============
Item was added:
+ ----- Method: SequenceableCollection>>indicesOfSubCollection: (in category 'accessing') -----
+ indicesOfSubCollection: subCollection
+ "Answer an Array (possibly empty) of all the indices of subCollection in the receiver."
+
+ ^self indicesOfSubCollection: subCollection startingAt: 1!
Item was added:
+ ----- Method: SequenceableCollection>>indicesOfSubCollection:startingAt: (in category 'accessing') -----
+ indicesOfSubCollection: subCollection startingAt: initialIndex
+ "Answer an Array (possibly empty) of all the indices of subCollection in the receiver starting at
+ initialIndex. N.B. This does not (yet) use Boyer-Moore to skip over unnecessary alignments."
+
+ ^Array streamContents:
+ [:s| | index |
+ index := initialIndex - 1.
+ [(index := self indexOfSubCollection: subCollection startingAt: index + 1) = 0] whileFalse:
+ [s nextPut: index]]!
Item was added:
+ ----- Method: WeakArray class>>primitiveFetchMourner (in category 'private') -----
+ primitiveFetchMourner
+ "Answer the next mourner in the VM's queue of objects to be finalized.
+ The queue contains weak arrays and ephemerons. If the primitive is
+ not implemented, raise an error telling people to upgrade the VM. If
+ implemented, the primitive fails if the queue is empty, with the error
+ code #'not found'. Primitive. Essential."
+
+ <primitive: 172 error: ec>
+ ec ifNil: [^self error: 'The primitiveFetchMourner primitive is missing.\Please upgrade your virtual machine to one that has the primitive.' withCRs].
+ ^nil!
Item was changed:
----- Method: WeakArray class>>restartFinalizationProcess (in category 'private') -----
restartFinalizationProcess
"kill any old process, just in case"
+ FinalizationProcess ifNotNil:
+ [FinalizationProcess terminate.
+ FinalizationProcess := nil].
- FinalizationProcess
- ifNotNil: [FinalizationProcess terminate.
- FinalizationProcess := nil].
FinalizationSemaphore := Smalltalk specialObjectsArray at: 42.
FinalizationDependents ifNil: [FinalizationDependents := WeakArray new: 10].
FinalizationLock := Semaphore forMutualExclusion.
FinalizationProcess := [self finalizationProcess]
+ forkAt: Processor userInterruptPriority + 1
+ named: 'the finalization process'!
- forkAt: Processor userInterruptPriority!