Version 1.5 of ScalaCheck [1] is now available. ScalaCheck is a tool for automatic unit testing of your Scala and Java programs, developed by Rickard Nilsson. ScalaCheck allows you to define general properties about your code units, while the tool handles all test data generation for you: you can run thousands of unit tests automatically without writing and maintaining an endless number of test cases. ScalaCheck started out as a Scala port of the Haskell library QuickCheck, and has since evolved and been extended with features not found in Haskell QuickCheck.
Version 1.5 of ScalaCheck introduces support for Scala 2.7.2 and various minor feature additions. Please visit http://www.scalacheck.org [2] for change history, user guide, API reference and more.
A small example, using the Scala interpreter with ScalaCheck on the path:
scala> object StringProps extends org.scalacheck.Properties("String") { | specify("startsWith", (a:String, b:String) => | (a+b).startsWith(a) | ) | specify("substring", (a:String, b:String) => | (a+b).substring(a.length) == b | ) | } defined module StringProps scala> StringProps.check + String.startsWith: OK, passed 100 tests. + String.substring: OK, passed 100 tests.
sbaz update sbaz install scalacheck
If you already have an earlier version of ScalaCheck installed, you just need to run:
sbaz upgrade
<repositories> <repository> <id>scala-tools.org</id> <name>Scala-Tools Maven2 Repository</name> <url>http://scala-tools.org/repo-releases</url> </repository> </repositories> <dependency> <groupId>org.scalacheck</groupId> <artifactId>scalacheck</artifactId> <version>1.5</version> </dependency>
Links:
[1] http://www.scalacheck.org
[2] http://www.scalacheck.org/
[3] http://code.google.com/p/scalacheck/wiki/ChangeHistory
[4] http://code.google.com/p/scalacheck/wiki/UserGuide
[5] http://scalacheck.googlecode.com/svn/artifacts/1.5/doc/api/index.html
[6] http://groups.google.com/group/scalacheck
[7] http://scalacheck.googlecode.com/files/ScalaCheck-1.5.jar
[8] http://scalacheck.googlecode.com/files/ScalaCheck-1.5-src.jar
[9] http://scalacheck.googlecode.com/svn/
[10] http://scala-tools.org