mirror of https://github.com/sbt/sbt.git
Test for projects using continuations
This commit is contained in:
parent
7efd2b6e91
commit
71bde490de
|
|
@ -0,0 +1,2 @@
|
|||
project.name=Continuations
|
||||
project.version=0.1
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import sbt._
|
||||
|
||||
class Continuations(info: ProjectInfo) extends DefaultProject(info) with AutoCompilerPlugins
|
||||
{
|
||||
val cont = compilerPlugin("org.scala-lang.plugins" % "continuations" % "2.8.0.RC1")
|
||||
override def compileOptions = super.compileOptions ++ compileOptions("-P:continuations:enable")
|
||||
|
||||
val junit = "junit" % "junit" % "4.7" % "test"
|
||||
val bryanjswift = "Bryan J Swift Repository" at "http://repos.bryanjswift.com/maven2/"
|
||||
val junitInterface = "com.novocode" % "junit-interface" % "0.4.0" % "test"
|
||||
|
||||
override def consoleInit = """assert(Examples.x == 20)"""
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import scala.util.continuations._
|
||||
|
||||
object Example {
|
||||
|
||||
val x =
|
||||
reset {
|
||||
shift { k: (Int=>Int) =>
|
||||
k(k(k(7)))
|
||||
} + 1
|
||||
} * 2
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import org.junit._
|
||||
import Assert._
|
||||
|
||||
class ContinuationsTest
|
||||
{
|
||||
@Test
|
||||
def basic
|
||||
{
|
||||
assertTrue(Example.x == 20)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
> ++2.8.0.RC1
|
||||
> update
|
||||
> compile
|
||||
> console
|
||||
> test-only ContinuationsTest
|
||||
Loading…
Reference in New Issue