Patrick Rein uploaded a new version of MorphicExtrasTests to project The Trunk: http://source.squeak.org/trunk/MorphicExtrasTests-pre.8.mcz
==================== Summary ====================
Name: MorphicExtrasTests-pre.8 Author: pre Time: 2 August 2023, 12:22:48.107105 pm UUID: 5581e401-42d8-0b40-86ce-9055bf9b4139 Ancestors: MorphicExtrasTests-ct.7
Adds tests for GH #80: 'preserver trash' preference ceased to work.
=============== Diff against MorphicExtrasTests-ct.7 ===============
Item was changed: SystemOrganization addCategory: #'MorphicExtrasTests-Postscript Filters'! SystemOrganization addCategory: #'MorphicExtrasTests-Flaps'! SystemOrganization addCategory: #'MorphicExtrasTests-Postscript Canvases'! SystemOrganization addCategory: #'MorphicExtrasTests-Demo'! + SystemOrganization addCategory: #'MorphicExtrasTests-Widgets'!
Item was added: + TestCase subclass: #TrashCanTest + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'MorphicExtrasTests-Widgets'!
Item was added: + ----- Method: TrashCanTest>>performTest (in category 'running') ----- + performTest + + | previousSetting | + previousSetting := TrashCanMorph preserveTrash. + [TrashCanMorph preserveTrash: true. + ^ super performTest] + ensure: [TrashCanMorph preserveTrash: previousSetting]!
Item was added: + ----- Method: TrashCanTest>>testLayoutingInScrapBook (in category 'tests') ----- + testLayoutingInScrapBook + + | morph newPage scrapBook | + scrapBook := ScrapBook new. + morph := RectangleMorph new. + scrapBook addToTrash: morph. + newPage := scrapBook scrapBook pages last. + self assert: (newPage submorphs includes: morph). + self assert: (morph position - newPage position) abs < (100@100). + !
Item was added: + ----- Method: TrashCanTest>>testPreserveTrashPreferenceOff (in category 'tests') ----- + testPreserveTrashPreferenceOff + + | previousSetting morph scrapBook | + previousSetting := TrashCanMorph preserveTrash. + [TrashCanMorph preserveTrash: false. + scrapBook := ScrapBook new. + morph := RectangleMorph new. + scrapBook addToTrash: morph. + self assert: 1 equals: scrapBook scrapBook pages size.] + ensure: [TrashCanMorph preserveTrash: previousSetting] + + !
Item was added: + ----- Method: TrashCanTest>>testPreserveTrashPreferenceOn (in category 'tests') ----- + testPreserveTrashPreferenceOn + + | previousSetting morph scrapBook | + previousSetting := TrashCanMorph preserveTrash. + [TrashCanMorph preserveTrash: true. + scrapBook := ScrapBook new. + morph := RectangleMorph new. + scrapBook addToTrash: morph. + self assert: 2 equals: scrapBook scrapBook pages size.] + ensure: [TrashCanMorph preserveTrash: previousSetting] + + !
Item was added: + ----- Method: TrashCanTest>>testTrashingAMorphAddsAPAge (in category 'tests') ----- + testTrashingAMorphAddsAPAge + + | morph scrapBook | + scrapBook := ScrapBook new. + morph := RectangleMorph new. + scrapBook addToTrash: morph. + self assert: 2 equals: scrapBook scrapBook pages size.!
squeak-dev@lists.squeakfoundation.org