Test for projects using continuations

This commit is contained in:
Mark Harrah 2010-04-28 20:39:48 -04:00
parent 7efd2b6e91
commit 71bde490de
5 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,2 @@
project.name=Continuations
project.version=0.1

View File

@ -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)"""
}

View File

@ -0,0 +1,11 @@
import scala.util.continuations._
object Example {
val x =
reset {
shift { k: (Int=>Int) =>
k(k(k(7)))
} + 1
} * 2
}

View File

@ -0,0 +1,11 @@
import org.junit._
import Assert._
class ContinuationsTest
{
@Test
def basic
{
assertTrue(Example.x == 20)
}
}

View File

@ -0,0 +1,5 @@
> ++2.8.0.RC1
> update
> compile
> console
> test-only ContinuationsTest