Skip to content

Commit

Permalink
chore: Add rt.jar test
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Aug 15, 2024
1 parent f74522a commit 5651122
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ final class BloopHighLevelCompiler(
if (scalac.scalaInstance.libraryJars().isEmpty) {
throw new CompileFailed(new Array(0), s"Expected Scala library jar in Scala instance containing ${scalac.scalaInstance.allJars().mkString(", ")}", new Array(0))
}
println(classpath)
try {
scalac.compile(
sources.toArray,
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/test/scala/bloop/BaseCompileSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1930,4 +1930,23 @@ abstract class BaseCompileSpec extends bloop.testing.BaseSuite {

}
}

test("unsafe") {
TestUtil.withinWorkspace { workspace =>
val sources = List(
"""/main/scala/Foo.scala
|import sun.misc.Unsafe
|class Foo
""".stripMargin
)

val logger = new RecordingLogger(ansiCodesSupported = false)
val `A` = TestProject(workspace, "a", sources)
val projects = List(`A`)
val state = loadState(workspace, projects, logger)
val compiledState = state.compile(`A`)
assertExitStatus(compiledState, ExitStatus.Ok)
assertValidCompilationState(compiledState, projects)
}
}
}

0 comments on commit 5651122

Please sign in to comment.