Skip to content

Commit

Permalink
Merge pull request #752 from adpi2/add-test-no-indent
Browse files Browse the repository at this point in the history
Add evaluation test with -no-indent
  • Loading branch information
adpi2 authored Sep 4, 2024
2 parents 607f3f4 + e410e18 commit 11ce5f2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2748,4 +2748,24 @@ abstract class ScalaEvaluationTests(scalaVersion: ScalaVersion) extends DebugTes
Evaluation.success("c.x", "x")
)
}

test("evaluation with -no-indent") {
assume(scalaVersion.isScala3)
val source =
"""|package example
|
|object Main {
| def main(args: Array[String]): Unit =
| println(1 + 2)
| val x = 1
| x + 1
|}
|""".stripMargin
implicit val debuggee: TestingDebuggee =
TestingDebuggee.mainClass(source, "example.Main", scalaVersion, Seq("-no-indent"))
check(
Breakpoint(5),
Evaluation.success("1 + 2", 3)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ import ch.epfl.scala.debugadapter.Library
import java.nio.file.Paths
import ch.epfl.scala.debugadapter.SourceJar
import munit.Location
import scala.util.Properties

/**
* This is a test class that also
* prints some stats about loading the look-up of some libraries
*/
class ClassEntryLookUpStats extends FunSuite {
// not working on Mac anymore because of JVM index
override def munitIgnore: Boolean = Properties.isMac

override def munitTimeout: Duration = 120.seconds
private val jvmCache = JvmCache().withDefaultIndex

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import ch.epfl.scala.debugadapter.SourceJar
import ch.epfl.scala.debugadapter.Library
import ch.epfl.scala.debugadapter.testfmk.NoopLogger
import munit.FunSuite
import scala.util.Properties

class SourceLookUpProviderSpec extends FunSuite {
test("fix https://github.com/scalameta/metals/issues/3477#issuecomment-1013458270") {
assume(!Properties.isMac) // TODO not working on MacOS
val artifacts = coursier
.Fetch()
.addDependencies(Dependency(Module(Organization("org.openjfx"), ModuleName("javafx-controls")), "17.0.1"))
Expand Down

0 comments on commit 11ce5f2

Please sign in to comment.