The Inbox: KernelTests-tonyg.382.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: KernelTests-tonyg.382.mcz

commits-2
A new version of KernelTests was added to project The Inbox:
http://source.squeak.org/inbox/KernelTests-tonyg.382.mcz

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

Name: KernelTests-tonyg.382
Author: tonyg
Time: 4 June 2020, 7:51:00.716353 pm
UUID: 8b08a8d8-6d8e-4836-b06a-4743168a3c5f
Ancestors: KernelTests-tonyg.381

More Promise tests for Promise/A+ behaviour.

=============== Diff against KernelTests-tonyg.381 ===============

Item was added:
+ ----- Method: PromiseTest>>testNilErrBlockPropagation (in category 'tests - monad') -----
+ testNilErrBlockPropagation
+ "https://promisesaplus.com section 2.2.7.4"
+ | p q |
+ p := Promise new.
+ q := p then: [:v | self error: 'Shouldn''t call resolvedBlock'] ifRejected: nil.
+ p rejectWith: 1.
+ self assert: p isRejected.
+ self assert: q isRejected.
+ self assert: p error equals: 1.
+ self assert: q error equals: 1.!

Item was added:
+ ----- Method: PromiseTest>>testNilResolvedBlockPropagation (in category 'tests - monad') -----
+ testNilResolvedBlockPropagation
+ "https://promisesaplus.com section 2.2.7.3"
+ | p q |
+ p := Promise new.
+ q := p then: nil ifRejected: [:e | self error: 'Shouldn''t call errBlock'].
+ p resolveWith: 1.
+ self assert: p isResolved.
+ self assert: q isResolved.
+ self assert: p value equals: 1.
+ self assert: q value equals: 1.!