mirror of https://github.com/sbt/sbt.git
Add scripted test for nested test classes/objects
This commit is contained in:
parent
b19bd33dc0
commit
24a463cc6b
|
|
@ -0,0 +1,8 @@
|
|||
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.5" % "test"
|
||||
|
||||
version := "0.0.1"
|
||||
name := "broken"
|
||||
organization := "org.catastrophe"
|
||||
//scalaVersion := "2.10.6"
|
||||
scalaVersion := "2.12.3"
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package q
|
||||
|
||||
//
|
||||
// On 1.0.3+ this test will say:
|
||||
// [info] + Nesting.startsWith: OK, passed 100 tests.
|
||||
// [info] Passed: Total 1, Failed 0, Errors 0, Passed 1
|
||||
//
|
||||
// On 1.0.0 to 1.0.2 it will crash with:
|
||||
// [error] java.lang.ClassNotFoundException: q.X.Y$
|
||||
//
|
||||
|
||||
import org.scalacheck.{Prop, Properties}
|
||||
import Prop.forAll
|
||||
|
||||
class U extends Properties("Nesting")
|
||||
object X extends U {
|
||||
property("startsWith") = forAll { (a: String, b: String) =>
|
||||
(a+b).startsWith(a)
|
||||
}
|
||||
object Y extends U {
|
||||
property("endsWith") = forAll { (a: String, b: String) =>
|
||||
(a+b).endsWith(b)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
> test
|
||||
|
||||
Loading…
Reference in New Issue