diff --git a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/build.sbt b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/build.sbt index cbef99eb41ac..1305c503f3be 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/build.sbt +++ b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/build.sbt @@ -1,7 +1,7 @@ scalaVersion := sys.props("plugin.scalaVersion") libraryDependencies ++= Seq( - "ch.epfl.lamp" % "dotty_0.14" % scalaVersion.value, - "ch.epfl.lamp" % "dotty_0.14" % scalaVersion.value % "test->runtime", + "ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value, + "ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value % "test->runtime", "com.novocode" % "junit-interface" % "0.11" % "test" - ) \ No newline at end of file + ) diff --git a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/test/scala/hello/Tests.scala b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/test/scala/hello/Tests.scala new file mode 100644 index 000000000000..4a04aadac601 --- /dev/null +++ b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/test/scala/hello/Tests.scala @@ -0,0 +1,36 @@ +package hello + +import org.junit.Test + +// Import Expr and some extension methods +import scala.quoted._ + +class Tests { + + implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader) + + @Test def test(): Unit = { + import hello.Main._ + + val square = stagedPower(2) + + assert(Math.pow(3, 2) == square(3)) + + square(3) + square(4) + + assert(Math.pow(4, 2) == square(4)) + + val cube = stagedPower(3) + cube(2) + + + assert(Math.pow(2, 3) == cube(2)) + + + + val toTheFourth = stagedPower(4) + assert(Math.pow(3, 4) == toTheFourth(3)) + } + +} diff --git a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/test b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/test index 62ea636c177f..ae36aea43f03 100644 --- a/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/test +++ b/sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/test @@ -1 +1,2 @@ > run +> test