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'!