[squeak-dev] Why isn't BlockClosureTest>>testCull failing?

David T. Lewis lewis at mail.msen.com
Sun Oct 26 00:23:51 UTC 2014


If we have this:
	[ :x | ] value: 1 ==> nil

And this:
	([ :x | ] cull: 1) ==> nil

But in BlockClosureTest>>testCull, we have this:

	self assert: 1 equals: ([ :x | ] cull: 1).

The test passes. How is this possible?

If I rewrite that line in the test as follows, then it fails as I would expect:

	foo := [ :x | ] cull: 1.
	self assert: 1 equals: foo.

Ah, but wait. If I revert the test method back to the original, presumably
recompiling it in the process, the test now fails exactly as I would have
expected.

The test also fails in the way I would expect in a 68002 format image,
which is what prompted me to ask the question.

The previous version of #testCull and related tests seem to pass and look
plausibly correct to me. The current (newer) version looks wrong to me, but
seems to inexplicably pass until the test is recompiled.

Dave



More information about the Squeak-dev mailing list