This page is no longer maintained — Please continue to the home page atwww.scala-lang.org
Version 1.5 ofScalaCheck 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 visithttp://www.scalacheck.org 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 StringPropsscala> StringProps.check+ String.startsWith: OK, passed 100 tests.+ String.substring: OK, passed 100 tests.sbaz updatesbaz 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>
Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland