aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run/t7582-private-within
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-12 18:30:53 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-12 18:30:53 +0200
commit89bacb9c25a58454ff1878e67f7ea07ffc8c269f (patch)
tree51f1ff6c66aebe1b6109b1cffcc2bb8e4cf760a3 /tests/pending/run/t7582-private-within
parenta0fa33deafbea1bf53edc068c5ed9db5592822f9 (diff)
downloaddotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.tar.gz
dotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.tar.bz2
dotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.zip
Run tests as they were in scala.
Diffstat (limited to 'tests/pending/run/t7582-private-within')
-rw-r--r--tests/pending/run/t7582-private-within/JavaPackagePrivate.java8
-rw-r--r--tests/pending/run/t7582-private-within/Test.scala22
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/pending/run/t7582-private-within/JavaPackagePrivate.java b/tests/pending/run/t7582-private-within/JavaPackagePrivate.java
new file mode 100644
index 000000000..672d19b57
--- /dev/null
+++ b/tests/pending/run/t7582-private-within/JavaPackagePrivate.java
@@ -0,0 +1,8 @@
+package pack;
+
+class JavaPackagePrivate {
+ int field = 0;
+ static int staticField = 0;
+ void meth() { }
+ static void staticMeth() { }
+}
diff --git a/tests/pending/run/t7582-private-within/Test.scala b/tests/pending/run/t7582-private-within/Test.scala
new file mode 100644
index 000000000..3d581f063
--- /dev/null
+++ b/tests/pending/run/t7582-private-within/Test.scala
@@ -0,0 +1,22 @@
+import scala.tools.partest.DirectTest
+
+// Testing that the `privateWithin` field is correctly populated on all
+// the related symbols (e.g. module class) under separate compilation.
+object Test extends DirectTest {
+ def code = ???
+
+ def show(): Unit = {
+ val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator")
+ val global = newCompiler("-usejavacp", "-cp", classpath, "-d", testOutput.path)
+ import global._
+ withRun(global) { _ =>
+ def check(sym: Symbol) = {
+ sym.initialize
+ println(f"${sym.accessString}%12s ${sym.accurateKindString} ${sym.name.decode}") // we want to see private[pack] for all of these.
+ }
+ val sym = rootMirror.getRequiredClass("pack.JavaPackagePrivate")
+ val syms = Seq(sym, sym.companionModule, sym.companionModule.moduleClass)
+ (syms ++ syms.flatMap(_.info.decls)).foreach(check)
+ }
+ }
+}