[ANN] SUnitExtensions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] SUnitExtensions

Hernan Wilkinson
Hi,
    we created a project in SqueakSource called SUnitExtensions with
extensions we added to SUnit.
    This package is needed to run the test of Aconcagua (see next mail!)
    The extensions are:  
    * TestCase>>should: aBlock raise: anException withExceptionDo:
anotherBlock
    * TestCase>>should: aBlock notTakeMoreThanMilliseconds: anInteger
    * TestCase>>fail

    This are very useful methods... it would be nice to have them in the
SUnit package...
    Right now we created this package to be able to run the Aconcagua
tests. If they are added to the SUnit package, we can delete it.

    See http://www.squeaksource.com/SUnitExtensions.html

    Bye,
    Hernan.

--
______________________________
Lic. Hernán A. Wilkinson
Gerente de Desarrollo y Tecnología
Mercap S.R.L.
Tacuari 202 - 7mo Piso - Tel: 54-11-4878-1118
Buenos Aires - Argentina
http://www.mercapsoftware.com
---------------------------------------------------------------------
Este mensaje es confidencial. Puede contener informacion amparada
por el secreto profesional. Si usted ha recibido este e-mail por error,
por favor comuniquenoslo inmediatamente via e-mail y tenga la
amabilidad de eliminarlo de su sistema; no debera copiar el mensaje
ni divulgar su contenido a ninguna persona. Muchas gracias.
 
This message is confidential. It may also contain information that is
privileged or otherwise legally exempt from disclosure. If you have
received it by mistake please let us know by e-mail immediately and
delete it from your system; you should also not copy the message nor
disclose its contents to anyone. Thanks.
 ---------------------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] SUnitExtensions

Philippe Marschall
>     * TestCase>>should: aBlock notTakeMoreThanMilliseconds: anInteger
Shouldn't that be

* TestCase>>shouldnt: aBlock takeMoreThan: aDuration

milliSeconds would then be sent to anInteger

self shouldnt: [ ... ] takeMoreThan: 5 milliSeconds

Cheers
Philippe

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] SUnitExtensions

Hernan Wilkinson
--- In [hidden email], "Philippe Marschall"
<philippe.marschall@...> wrote:
>
> >     * TestCase>>should: aBlock notTakeMoreThanMilliseconds: anInteger
> Shouldn't that be
>
> * TestCase>>shouldnt: aBlock takeMoreThan: aDuration
>
> milliSeconds would then be sent to anInteger
>
> self shouldnt: [ ... ] takeMoreThan: 5 milliSeconds

Well, the problem is that your suggestion is not portable to other
Smalltalk (like VisualAge or GemStone, that are the ones we use...)
But yes, I agree that your suggestion is better.
I'd like this methods to be part of SUnit, so I guess the people that
maintain SUnit should have the last word about this.

Hernan.


>
> Cheers
> Philippe
>





Reply | Threaded
Open this post in threaded view
|

Re: [ANN] SUnitExtensions

Marcus Denker
In reply to this post by Hernan Wilkinson

On 28.03.2006, at 00:08, Hernan Wilkinson wrote:

>   The extensions are:      * TestCase>>should: aBlock raise:  
> anException withExceptionDo: anotherBlock
>    * TestCase>>should: aBlock notTakeMoreThanMilliseconds: anInteger
>    * TestCase>>fail
>
>    This are very useful methods... it would be nice to have them in  
> the SUnit package...


Ok, merged in in SUnit-md.32

(But keep in mind that this is the Squeak branch of Sunit... not the  
"beeing compatible
to even the strangest smalltalk at the expense of getting nothing  
done at all" official SUnit)

Name: SUnit-md.32
Author: md
Time: 2 April 2006, 2:05:33 pm
UUID: fcc38149-c240-11da-8443-000d933a223c
Ancestors: SUnit-md.31

        From:  [hidden email]
        Subject: [ANN] SUnitExtensions
        Date: 28. März 2006 00:08:05 GMT+02:00
        To:  [hidden email]
        Reply-To:  [hidden email]

   The extensions are:      * TestCase>>should: aBlock raise:  
anException withExceptionDo: anotherBlock
    * TestCase>>should: aBlock notTakeMoreThanMilliseconds: anInteger
    * TestCase>>fail

    This are very useful methods... it would be nice to have them in  
the SUnit package...
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] SUnitExtensions

Brent Pinkney
Hi,

>     * TestCase>>should: aBlock notTakeMoreThanMilliseconds: anInteger

Would it not be nicer to implement this using ANSI Durations rather then
milliseconds ? Something akin to #valueWithin:onTimeout:

My suggestion would be

        self
                assert: [ x doSomething ] within: 5 seconds.


Cheers

Brent

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] SUnitExtensions

Marcus Denker

On 02.04.2006, at 16:08, Brent Pinkney wrote:

> Hi,
>
>>     * TestCase>>should: aBlock notTakeMoreThanMilliseconds: anInteger
>
> Would it not be nicer to implement this using ANSI Durations rather  
> then
> milliseconds ? Something akin to #valueWithin:onTimeout:
>

Yes, I think phillipe suggested the same... let's do it.

> My suggestion would be
>
> self
> assert: [ x doSomething ] within: 5 seconds.
>

hmm... assert: allways takes an expression, should: takes a block in  
SUnit.
(the standard Object>>#assert: can have both a bock and a expression).

So for Sunit, it would be something like:

self shouldnt: [1 + 2] takeMoreThan: 3 seconds
or

self should: [1 + 2] takeNoMoreThan: 3 seconds

or, we could make change TestCase assert: to be like Object>>#assert:
and provide

        TestCase>>#assert: [ x doSomething ] within: 5 seconds.

Or just both? having TestCase>>#assert: to be the same semantics
like Objects>>assert: definitly makes sense...

       Marcus