[FIX][BUG] ExceptionTester>>simpleOuterTest fails
Tim Rowledge
tim at sumeru.stanford.edu
Fri May 28 04:51:55 UTC 2004
Anthony Hannan <ajhannan at yahoo.com> wrote:
> Hello guys,
>
> I do not believe David's change is correct. Maybe the #outer test cases are
> incorrect. Exception>>#outer is implemented according to the ANSI definition
> given to us by John Brant in a previous email
> (http://lists.squeakfoundation.org/pipermail/squeak-dev/2003-June/061349.html).
>
It looks to me (after spending a lot of time looking round the web for
Smalltalk exception related stuff and making my head spin around axes I
didn't think existed outside a superstring) that the example ought to
work thus:-
simpleOuterTest
"uses #resume"
[[self doSomething.
MyTestNotification signal.
self doSomethingElse]
on: MyTestNotification
do: [:ex | ex outer]]
on: MyTestNotification
do: [:ex | self doYetAnotherThing. ex resume]
We correctly get doSomething. Then MyTestNotification is signalled and
we climb up to the first handler. This sends #outer which is supposed
to 'mark' the handler block and then pass on the signal. This _ought_
to go on up to the second handler and give us doYetAnotherThing. Then
we resume - and that should resume in the 'outerd' block _not_ the
original block.
Which indeed would appear to fail the test according to the test code.
If I change the test to follow my understanding we get:-
simpleOuterTest
"uses #resume"
[[self doSomething.
MyTestNotification signal.
"self doSomethingElse"
self doSomethingExceptional]
on: MyTestNotification
do: [:ex | ex outer. self doSomethingElse]]
on: MyTestNotification
do: [:ex | self doYetAnotherThing. ex resume]
...and the test now seems to pass and we do not get an error.
So, my opinion as of this late hour is that the test is fsck'd. Am I
right or am I hallucinating?
tim
--
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Strange OpCodes: RIW: Re-Invent Wheel
More information about the Squeak-dev
mailing list
|