diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2016-11-30 14:58:01 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-30 14:58:01 +1000 |
commit | 0339663cbbd4d22b0758257f2ce078b5a007f316 (patch) | |
tree | 75b5cb23e987dddefb227545d4e1028c487c8b78 /test/files/run/sd275-java/Test.scala | |
parent | 711e261717c37dcc56e4f67230a4e8b4f5500700 (diff) | |
parent | 31723573b3a25cd27f2b5c1079dfb04c5b10910a (diff) | |
download | scala-0339663cbbd4d22b0758257f2ce078b5a007f316.tar.gz scala-0339663cbbd4d22b0758257f2ce078b5a007f316.tar.bz2 scala-0339663cbbd4d22b0758257f2ce078b5a007f316.zip |
Merge pull request #5562 from retronym/ticket/SD-275
SD-275 Further harden against refs to absentee classes
Diffstat (limited to 'test/files/run/sd275-java/Test.scala')
-rw-r--r-- | test/files/run/sd275-java/Test.scala | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/files/run/sd275-java/Test.scala b/test/files/run/sd275-java/Test.scala new file mode 100644 index 0000000000..84187527d2 --- /dev/null +++ b/test/files/run/sd275-java/Test.scala @@ -0,0 +1,39 @@ +import scala.tools.partest._ +import java.io.File + +object Test extends StoreReporterDirectTest { + def code = ??? + + def compileCode(code: String) = { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code) + } + + def show(): Unit = { + deletePackage("p1/p2/p3") + deletePackage("p1/p2") + + compileCode(""" +package sample + +class Test { + final class Inner extends A.A_Inner { + def foo = 42 + } + + def test = new Inner().foo +} + """) + assert(storeReporter.infos.isEmpty, storeReporter.infos.mkString("\n")) + } + + def deletePackage(name: String) { + val directory = new File(testOutput.path, name) + for (f <- directory.listFiles()) { + assert(f.getName.endsWith(".class")) + assert(f.delete()) + } + assert(directory.listFiles().isEmpty) + assert(directory.delete()) + } +} |