The Trunk: Tests-nice.446.mcz

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

The Trunk: Tests-nice.446.mcz

commits-2
Nicolas Cellier uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-nice.446.mcz

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

Name: Tests-nice.446
Author: nice
Time: 11 April 2021, 10:10:51.107508 am
UUID: 4bf76380-a2ad-41d3-a16b-8684a2a9b938
Ancestors: Tests-tobe.445

The defaultAction of an Exception should be evaluated in the Context of the method that signalled the Exception.

Thus, an enclosing exception handler (on:do:) upper in the stack shall still be active whenever the defaultAction raise another exception.

This documents why simply deactivating the exception (see handlerActive, tempAt: 3, of #on:do:) is not the right way to fix handling of nested exception.
See #testHandlerFromAction, see also
https://source.squeak.org/treated/Kernel-ar.540.diff

=============== Diff against Tests-tobe.445 ===============

Item was added:
+ ----- Method: ExceptionTests>>testCatchingDefaultAction (in category 'tests - outer') -----
+ testCatchingDefaultAction
+ "The #defaultAction method is executed in the context of the signaling environment.
+ The defaultAction will raise an UnhandledWarning that should be caught by this handler."
+ | result |
+ result := [ Warning signal: 'Warning signalled' ] on: UnhandledWarning do: [ :ex | 'UnhandledWarning caught' ].
+ self assert: 'UnhandledWarning caught' equals: result!