Hi Christoph,

On 02-Jan-24 8:10:55 PM, christoph.thiede@student.hpi.uni-potsdam.de wrote:

+1 provided that no one objects against this breaking change after a couple of days (see https://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfoundation.org/thread/FAPYVA4R2V42KTNJTTW5EKUUESR6V34G/).

And you omitted two chances for #assert:equals: again. But maybe that's a style questions only. After all, we are obfuscating our tests and testing framework by duplicating basic protocols from the rest of the systems, for the sole purpose of generating better assertion error messages. :-) I agree with Eliot when he suggested a couple of years ago to use metaprogramming for generating these messages instead (I can try to find that thread again when you're interested).

Yes please, if you don't mind. Thanks!



Best,
Christoph

---
Sent from Squeak Inbox Talk

On 2024-01-02T11:28:09+00:00, commits@source.squeak.org wrote:

> A new version of KernelTests was added to project The Inbox:
> http://source.squeak.org/inbox/KernelTests-jar.449.mcz
>
> ==================== Summary ====================
>
> Name: KernelTests-jar.449
> Author: jar
> Time: 2 January 2024, 12:28:08.184411 pm
> UUID: decf5a85-87ad-5849-b692-ee28940eab41
> Ancestors: KernelTests-jar.448
>
> Test if #return:from: correctly handles returns to nil contexts
>
> =============== Diff against KernelTests-jar.448 ===============
>
> Item was added:
> + ----- Method: ContextTest>>testBlockCannotReturnToNil (in category 'tests') -----
> + testBlockCannotReturnToNil
> +     "Test if #return:from: correctly handles returns to dead or nil contexts."
> +
> +     | context nextContext |
> +     context := [] asContext.
> +     
> +     "assert p is at the last instruction, i.e. a return, and is about to return to a nil context"
> +     self assert: context method selector = thisContext method selector.
> +     self assert: context sender isNil.
> +     self assert: context willReturn.
> +     self assert: context atEnd.
> +     
> +     nextContext := context step. "step into a return to a nil sender"
> +
> +     self assert: nextContext method selector = #cannotReturn:!