[squeak-dev] The Trunk: KernelTests-tonyg.318.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Feb 18 07:44:48 UTC 2017


Tobias Pape uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-tonyg.318.mcz

==================== Summary ====================

Name: KernelTests-tonyg.318
Author: tonyg
Time: 17 February 2017, 2:10:54.13995 pm
UUID: 550fed38-fe11-4cea-bccb-2e3c13b421d0
Ancestors: KernelTests-nice.317

Add tests for Promise>>wait (including proposed change from Kernel-tonyg.1059)

=============== Diff against KernelTests-nice.317 ===============

Item was added:
+ ----- Method: PromiseTest>>testWaitForRejection (in category 'testing - monad') -----
+ testWaitForRejection
+ 	| p |
+ 	p := Promise new.
+ 	[ (Delay forMilliseconds: 1) wait. p rejectWith: Error new ] fork.
+ 	self should: [ p wait ] raise: BrokenPromise.!

Item was added:
+ ----- Method: PromiseTest>>testWaitForResolution (in category 'testing - monad') -----
+ testWaitForResolution
+ 	| p |
+ 	p := Promise new.
+ 	[ (Delay forMilliseconds: 1) wait. p resolveWith: #ok ] fork.
+ 	self assert: [ p wait = #ok ]!

Item was added:
+ ----- Method: PromiseTest>>testWaitRejectionYieldsCorrectBrokenPromise (in category 'testing - monad') -----
+ testWaitRejectionYieldsCorrectBrokenPromise
+ 	| p |
+ 	p := Promise new.
+ 	[ (Delay forMilliseconds: 1) wait. p rejectWith: Error new ] fork.
+ 	[ p wait ] on: BrokenPromise do: [ :bp | ^ self assert: [ bp promise == p ] ].
+ 	self fail: 'Should not reach this point'!



More information about the Squeak-dev mailing list