--- a/RegressionTests__BlockTest.st Fri May 24 19:59:53 2013 +0200
+++ b/RegressionTests__BlockTest.st Fri May 24 20:08:09 2013 +0200
@@ -229,7 +229,7 @@
trace add:22.
].
] ensure:[
- trace add:31.
+ trace add:30.
ensureCount := ensureCount + 1.
].
trace add:40.
@@ -237,7 +237,44 @@
self assert:(callCount == 2).
self assert:(ensureCount == 2).
- self assert:(trace asArray = #(10 15 20 21 31 15 20 31 40)).
+ self assert:(trace asArray = #(10 15 20 21 30 15 20 30 40)).
+!
+
+test_unwind2
+ <context: #return>
+
+ |mark trace firstEntry callCount ensureCount kon|
+
+ kon := thisContext.
+ mark isNil ifTrue:[
+ mark := true.
+ trace := OrderedCollection new.
+ firstEntry := true.
+ callCount := ensureCount := 0.
+ trace add:5.
+ ].
+
+ trace add:10.
+
+ [
+ trace add:20.
+ callCount := callCount + 1.
+ firstEntry ifTrue:[
+ trace add:21.
+ firstEntry := false.
+ kon unwindAndRestart.
+ trace add:22.
+ ].
+ ] ensure:[
+ trace add:30.
+ ensureCount := ensureCount + 1.
+ ].
+
+ trace add:40.
+
+ self assert:(callCount == 2).
+ self assert:(ensureCount == 2).
+ self assert:(trace asArray = #(5 10 20 21 30 10 20 30 40)).
! !
!BlockTest methodsFor:'varArgBlocks'!