Mantis - Squeak
Viewing Issue Advanced Details
3718 Morphic minor always 05-25-06 23:44 07-14-06 15:42
closed 3.9  
0003718: Failures in BlockContextTest>>testSupplyAnswer*
Tests on BlockContextTest (and subclasses) that involves the messages #valueSupplyingAnswer: and #valueSupplyingAnswers: , fails because:

The test uses [ self confirm: 'bla bla' ] valueSupplyingAnswer: ...

But #valueSupplyingAnswer: supplies an answer only if the block signals ProvideAnswerNotification, in other case returns the result of the block.
Object>>confirm: never raises ProvideAnswerNotification, so the result is the result of the confirmation. (so the test is not testing the implementation of valueSupplyingAnswer: and the success depends on the response to the confirmation)

Solution proposals:

(1) Change the test and the comment of #valueSupplyingAnswers: to indicate that it applies only to block that signals ProvideAnswerNotification.
Modify the test, to be like this:
self should: [[ ProvideAnswerNotification signal: 'Smalltalk' ] valueSupplyingAnswer: #('Smalltalk' true) ]

(2) Change Object>>confirm: to signal ProvideAnswerNotification.

(3) In my image (3.9b-7032) the only sender of #valueSupplyingAnswers: is the test. I don't known if this message is used by other packages, but since this is used only by FillInTheBlankMorph, I think that #valueSupplyingAnswers: belongs to the FillInTheBlankMorph and not to BlockContext!

In either case is convenient that test didn't display any confirmation dialog. (tests must run without user interaction)

With this bug report I have included a change set to implement the solution (1), because is easier to do. But I prefer the solution no. (3)
related to 0003719closed  Test BlockContextTest>>testSuppressInform* are incorrect 
 BlockContextTestValueSupplyingAnswer.1.cs [^] (2,083 bytes) 05-25-06 23:44

07-14-06 15:42