[squeak-dev] The Inbox: Tests-ct.448.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Apr 12 19:19:05 UTC 2021


A new version of Tests was added to project The Inbox:
http://source.squeak.org/inbox/Tests-ct.448.mcz

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

Name: Tests-ct.448
Author: ct
Time: 12 April 2021, 9:19:02.66824 pm
UUID: 65aa0e1a-250a-724a-9f04-505db0722916
Ancestors: Tests-nice.447

Revises ExceptionTests >> #testCatchingDefaultAction to work when being debugged/simulated as well. This also decouples the test from the implementation details of UnhandledWarnings.

For further reference, see also: https://github.com/LinqLover/SimulationStudio/runs/2319502648?check_suite_focus=true#step:4:441

=============== Diff against Tests-nice.447 ===============

Item was changed:
  ----- Method: ExceptionTests>>testCatchingDefaultAction (in category 'tests - outer') -----
  testCatchingDefaultAction
+ 	"The #defaultAction method is executed in the context of the signaling environment."
+ 
- 	"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 := [MyTestNotification signalForAction: [MyTestNotification signal: '2nd exception']]
+ 		on: MyTestNotification
+ 		do: [:ex | '2nd exception caught'].
+ 	self assert: '2nd exception caught' equals: result.!
- 	result := [ Warning signal: 'Warning signalled' ] on: UnhandledWarning do: [ :ex | 'UnhandledWarning caught' ].
- 	self assert: 'UnhandledWarning caught' equals: result!

Item was changed:
  Notification subclass: #MyTestNotification
+ 	instanceVariableNames: 'action'
- 	instanceVariableNames: ''
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'Tests-Exceptions'!

Item was added:
+ ----- Method: MyTestNotification class>>signalForAction: (in category 'signaling') -----
+ signalForAction: aBlock
+ 
+ 	^ self new
+ 		action: aBlock;
+ 		signal!

Item was added:
+ ----- Method: MyTestNotification>>action (in category 'accessing') -----
+ action
+ 
+ 	^ action!

Item was added:
+ ----- Method: MyTestNotification>>action: (in category 'accessing') -----
+ action: aBlock
+ 
+ 	action := aBlock!

Item was added:
+ ----- Method: MyTestNotification>>defaultAction (in category 'priv handling') -----
+ defaultAction
+ 
+ 	self action ifNotNil: [^ self action cull: self].
+ 	
+ 	^ super defaultAction!



More information about the Squeak-dev mailing list