diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-05-23 15:50:29 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-05-23 15:50:29 +0200 |
commit | 8e92ba0eb8c1e651c56493d00bc478ae7a3e9f39 (patch) | |
tree | a75c79945455e381f73016fac52c060051e23757 /test/files/run | |
parent | 95f57600a7498f269d32743788c89d4d65f93700 (diff) | |
parent | 883fdd74d63a54495f4013eef81c9b5ebc850d1c (diff) | |
download | scala-8e92ba0eb8c1e651c56493d00bc478ae7a3e9f39.tar.gz scala-8e92ba0eb8c1e651c56493d00bc478ae7a3e9f39.tar.bz2 scala-8e92ba0eb8c1e651c56493d00bc478ae7a3e9f39.zip |
Merge pull request #5153 from petermz/ticket/5463
SI-5463 Check .jars before using them
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t5463.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/run/t5463.scala b/test/files/run/t5463.scala new file mode 100644 index 0000000000..30b8306156 --- /dev/null +++ b/test/files/run/t5463.scala @@ -0,0 +1,21 @@ +import scala.reflect.internal.FatalError +import scala.tools.partest.DirectTest + +object Test extends DirectTest { + + def code = "class A" + + override def show(): Unit = { + // Create a broken JAR file and put it on compiler classpath + val jarpath = testOutput.path + "/notajar.jar" + scala.reflect.io.File(jarpath).writeAll("This isn't really a JAR file") + + val classpath = List(sys.props("partest.lib"), jarpath, testOutput.path) mkString sys.props("path.separator") + try { + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code) + throw new Error("Compilation should have failed"); + } catch { + case ex: FatalError => // this is expected + } + } +} |