[ENH] Assertion

Lex Spoon lex at cc.gatech.edu
Sun May 28 19:53:27 UTC 2000


Stephan Rudlof <sr at evolgo.de> wrote:

> > Adding an explanation is a great idea.  However, how about using a more
> > meaningful word than a generic "with" or "that".  For instance:
> > 
> >         self assert: [ x <= 0 ] explanation: 'x should be positive'
> > 
> > -Lex
> 
> I think you have meaned
> 	self assert: [ x > 0 ] explanation: 'x should be positive'
> , is this true?
> 


Err, yes.  My booboo.



> I think it should be clear, if the explanation is the description of the
> fulfilled or failed or both assertion cases; e.g.:

I agree--I had trouble with some of the earlier examples.  One solution
is to just be careful in the wording.  If you use the word "should", it
is clear that you are describing something that should have happened but
didn't.  If you say "X has happened" then it is clear that you are
describing the behavior that *did* happen but shouldn't have.



-Lex





More information about the Squeak-dev mailing list