Improved documentation on scala.testing.SUnit

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

Improved documentation on scala.testing.SUnit

Niko Korhonen
Do you think it would be possible to get some improved documentation
(and possibly more examples) on the scala.testing.SUnit object. The
current documentation is is very ... well ... /terse/, and I can't seem
to be able to figure out how to construct a real unit testing suite just
with the provided SUnit and UnitTest objects.

Besides, the example code is laid out wrong (no newlines) in the current
documentation on SUnit.

--
Niko Korhonen
SW engineer

Reply | Threaded
Open this post in threaded view
|

Re: Improved documentation on scala.testing.SUnit

Lex Spoon
Niko Korhonen <[hidden email]> writes:
> Do you think it would be possible to get some improved documentation
> (and possibly more examples) on the scala.testing.SUnit object. The
> current documentation is is very ... well ... /terse/, and I can't
> seem to be able to figure out how to construct a real unit testing
> suite just with the provided SUnit and UnitTest objects.
>
> Besides, the example code is laid out wrong (no newlines) in the
> current documentation on SUnit.


I cannot help with SUnit except to echo what you say.  It looks cool,
but I have not loked into it, and more docs would be nice.

On a related topic, you can use JUnit itself if you like.  Some
example code is at:

http://lampsvn.epfl.ch/svn-repos/scala/sbaz/trunk/tests/sbaz/


-Lex


Reply | Threaded
Open this post in threaded view
|

Re: Improved documentation on scala.testing.SUnit

griba2010
In reply to this post by Niko Korhonen
Hi!

I tried to use, some time ago, the incomplete example from the documentation, and I rebuilt it and
post it at the Scala wiki.

http://scala.sygneca.com/faqs/api#scala.testing.sunit-example

Cheers.
Gabriel.

"Niko Korhonen" <[hidden email]> ha escrit en el missatge dels grups de
discussió:e24q1q$kcf$[hidden email]...

> Do you think it would be possible to get some improved documentation
> (and possibly more examples) on the scala.testing.SUnit object. The
> current documentation is is very ... well ... /terse/, and I can't seem
> to be able to figure out how to construct a real unit testing suite just
> with the provided SUnit and UnitTest objects.
>
> Besides, the example code is laid out wrong (no newlines) in the current
> documentation on SUnit.
>
> --
> Niko Korhonen
> SW engineer
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Improved documentation on scala.testing.SUnit

Niko Korhonen
In reply to this post by Lex Spoon
Lex Spoon wrote:
> On a related topic, you can use JUnit itself if you like.  Some
> example code is at:

That's what I've been using up to now. I just wanted to explore the
approach provided by Scala standard library. But let's just say that 3rd
party tools such as log4j and JUnit are currently much more usable than
what's provided in the standard library. Well, that's the point of Java
interoperability anyway :)

On a related note, I see that the recently released JUnit 4.0 now uses
Java 5 attributes (such as @Test) to define the test suite. Does anyone
know whether Scala supports those?

--
Niko Korhonen
SW engineer

Reply | Threaded
Open this post in threaded view
|

Re: Improved documentation on scala.testing.SUnit

Lex Spoon
Niko Korhonen <[hidden email]> writes:
> Lex Spoon wrote:
> > On a related topic, you can use JUnit itself if you like.  Some
> > example code is at:
>
> That's what I've been using up to now. I just wanted to explore the
> approach provided by Scala standard library. But let's just say that
> 3rd party tools such as log4j and JUnit are currently much more usable
> than what's provided in the standard library. Well, that's the point
> of Java interoperability anyway :)

Yes.

FWIW, the library areas where Scala is excellent are those where LAMP
has had people spend large amounts of full-time work.  Specifically,
the collections and the XML support are excellent.  I would imagine
the database support is nice as well, but have not yet looked into it.

FWIW, the ScalaSwing wrapper library also seems to be quite
convenient, albeit also limited.  For the widgets it supports, you can
register event handlers much more concisely than in Java.  For
example, here's code to react to a button press, increase a counter,
and change a text field to reflect the new counter value:

      reactions += {
        case ButtonPressed(button) =>
          numclicks = numclicks + 1
          text = prefix + numclicks
      }


Incidentally, anyone who has ideas for, e.g., a good unit testing
library, should feel free to whip something up and post it!


> On a related note, I see that the recently released JUnit 4.0 now uses
> Java 5 attributes (such as @Test) to define the test suite. Does
> anyone know whether Scala supports those?

Hopefully someone more knowledgable will jump in here, but I know at
least that attributes are an active development area at LAMP.  I do
not know whether there is anything usable at the moment....

-Lex


Reply | Threaded
Open this post in threaded view
|

Re: Improved documentation on scala.testing.SUnit

Niko Korhonen
Lex Spoon wrote:
> FWIW, the library areas where Scala is excellent are those where LAMP
> has had people spend large amounts of full-time work.  Specifically,
> the collections and the XML support are excellent.  I would imagine
> the database support is nice as well, but have not yet looked into it.

Agreed. The "computer sciency" bits of Scala are indeed excellent.
Besides the excellent containers and other standard library features, I
especially like the fact that one can program almost like in Haskell
with Scala, if necessary.

Scala is by far my favorite of the "new" languages. Previously I looked
very seriously into Boo (http://boo.codehaus.org) but I pretty much
dumped that after I found Scala. Boo's Ruby-style "1% FP plugged into
OOP" just doesn't match Scala's power.

If we could just get more compilers and supported platforms for Scala
(hint: gcc), life would be great.

--
Niko Korhonen
SW engineer