David T. Lewis uploaded a new version of MorphicTests to project The Trunk:
http://source.squeak.org/trunk/MorphicTests-dtl.44.mcz ==================== Summary ==================== Name: MorphicTests-dtl.44 Author: dtl Time: 17 November 2017, 10:00:40.18563 pm UUID: 74a707eb-bd44-445f-9737-a977ef236a35 Ancestors: MorphicTests-dtl.43 Remove unnecessary reference to global World. =============== Diff against MorphicTests-dtl.43 =============== Item was changed: ----- Method: WorldStateTest>>testDeferredUIQueueTimeout (in category 'tests') ----- testDeferredUIQueueTimeout "Ensure that the World's deferredUIMessage will take no more time than specified by WorldState's deferredExecutionTimeLimit" | firstWasRun secondWasRun thirdWasRun | firstWasRun := secondWasRun := thirdWasRun := false. WorldState addDeferredUIMessage:[ firstWasRun := true. (Delay forMilliseconds: WorldState deferredExecutionTimeLimit + 50) wait. ]. WorldState addDeferredUIMessage:[ secondWasRun := true. ]. WorldState addDeferredUIMessage:[ thirdWasRun := true. ]. self deny: firstWasRun. self deny: secondWasRun. self deny: thirdWasRun. + Project current world doOneCycleNow. - World doOneCycleNow. self assert: firstWasRun. self deny: secondWasRun. self deny: thirdWasRun. + Project current world doOneCycleNow. - World doOneCycleNow. self assert: firstWasRun. self assert: secondWasRun. self assert: thirdWasRun. ! |
Maybe we can draw inspiration from MorphicEventTests and set up a custom world and world state to write those tests w/o reyling on global system state. Btw.: WorldState is a global, too? :-O Best, Marcel
|
Free forum by Nabble | Edit this page |