From 7b208e4c6d0e57653d6dca60c505c95239f67e13 Mon Sep 17 00:00:00 2001 From: Adrien Piquerez Date: Tue, 15 Mar 2022 15:23:53 +0100 Subject: [PATCH 1/2] Bump junit-interface to 0.13.3 This is needed by the new TestExplorer in Metals: See https://github.com/scalameta/metals/blob/f0addba469ddccf743e4ffb68347597b27f2605e/metals/src/main/scala/scala/meta/internal/troubleshoot/ScalaProblem.scala#L90 --- compiler/test/dotty/tools/dotc/SettingsTests.scala | 2 +- project/Build.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/test/dotty/tools/dotc/SettingsTests.scala b/compiler/test/dotty/tools/dotc/SettingsTests.scala index dcee1ebde4f2..e3076f055d51 100644 --- a/compiler/test/dotty/tools/dotc/SettingsTests.scala +++ b/compiler/test/dotty/tools/dotc/SettingsTests.scala @@ -106,7 +106,7 @@ class SettingsTests { false val default = Settings.defaultState - assertThrows[IllegalArgumentException](checkMessage("found: not an option of type java.lang.String, required: Boolean")) { + dotty.tools.assertThrows[IllegalArgumentException](checkMessage("found: not an option of type java.lang.String, required: Boolean")) { Settings.option.updateIn(default, "not an option") } diff --git a/project/Build.scala b/project/Build.scala index 0b8318f35e05..9319e1621159 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -251,7 +251,7 @@ object Build { // Prevent sbt from rewriting our dependencies scalaModuleInfo ~= (_.map(_.withOverrideScalaVersion(false))), - libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test, + libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.3" % Test, // If someone puts a source file at the root (e.g., for manual testing), // don't pick it up as part of any project. @@ -1327,7 +1327,7 @@ object Build { "org.jsoup" % "jsoup" % "1.14.3", // Needed to process .html files for static site Dependencies.`jackson-dataformat-yaml`, - "com.novocode" % "junit-interface" % "0.11" % "test", + "com.github.sbt" % "junit-interface" % "0.13.3" % Test, ), Compile / mainClass := Some("dotty.tools.scaladoc.Main"), Compile / buildInfoKeys := Seq[BuildInfoKey](version), From 9b710fff74ad24abaddd76a3bfe8b1bb0158ab36 Mon Sep 17 00:00:00 2001 From: Adrien Piquerez Date: Tue, 15 Mar 2022 16:20:05 +0100 Subject: [PATCH 2/2] Add Playground to make debugging easier in Metals --- compiler/test/dotty/tools/dotc/Playground.scala | 13 +++++++++++++ tests/playground/example.scala | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 compiler/test/dotty/tools/dotc/Playground.scala create mode 100644 tests/playground/example.scala diff --git a/compiler/test/dotty/tools/dotc/Playground.scala b/compiler/test/dotty/tools/dotc/Playground.scala new file mode 100644 index 000000000000..40a24c0408cf --- /dev/null +++ b/compiler/test/dotty/tools/dotc/Playground.scala @@ -0,0 +1,13 @@ +package dotty.tools.dotc + +import dotty.tools.vulpix._ +import org.junit.Test +import org.junit.Ignore + +@Ignore class Playground: + import TestConfiguration._ + import CompilationTests._ + + @Test def example: Unit = + implicit val testGroup: TestGroup = TestGroup("playground") + compileFile("tests/playground/example.scala", defaultOptions).checkCompile() diff --git a/tests/playground/example.scala b/tests/playground/example.scala new file mode 100644 index 000000000000..29ea308f689b --- /dev/null +++ b/tests/playground/example.scala @@ -0,0 +1,4 @@ +object Test: + val foo: Int = 2 + def bar(x: Int): Int = x + x + bar(foo)