Skip to content

Commit

Permalink
Fix logging malformed JVM id when compiling (#2487)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gedochao authored Oct 24, 2023
1 parent 201a46e commit 72cca0b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2021,4 +2021,17 @@ abstract class RunTestDefinitions(val scalaVersionOpt: Option[String])
expect(withDependencyCacheWalkSize == os.walk(cachePath).size)
}
}

test("JVM id is printed with compilation info correctly") {
val msg = "Hello"
val input = "jvm.sc"
TestInputs(os.rel / input ->
s"""//> using jvm 11
|println("$msg")
|""".stripMargin).fromRoot { root =>
val res = os.proc(TestUtil.cli, "run", extraOptions, input).call(cwd = root, stderr = os.Pipe)
expect(res.out.trim() == msg)
expect(res.err.trim().contains("JVM (11)"))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ final case class BuildOptions(
val platform0 = platform.value match {
case Platform.JVM =>
val jvmIdSuffix =
javaOptions.jvmIdOpt
javaOptions.jvmIdOpt.map(_.value)
.orElse(Some(javaHome().value.version.toString))
.map(" (" + _ + ")").getOrElse("")
s"JVM$jvmIdSuffix"
Expand Down

0 comments on commit 72cca0b

Please sign in to comment.