aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run/t4788
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/t4788
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/t4788')
-rw-r--r--tests/pending/run/t4788/C.scala2
-rw-r--r--tests/pending/run/t4788/CAnnotation.java5
-rw-r--r--tests/pending/run/t4788/D.scala5
-rw-r--r--tests/pending/run/t4788/R.scala2
-rw-r--r--tests/pending/run/t4788/RAnnotation.java5
-rw-r--r--tests/pending/run/t4788/S.scala2
-rw-r--r--tests/pending/run/t4788/SAnnotation.java5
-rw-r--r--tests/pending/run/t4788/Test.scala35
8 files changed, 61 insertions, 0 deletions
diff --git a/tests/pending/run/t4788/C.scala b/tests/pending/run/t4788/C.scala
new file mode 100644
index 000000000..aba9b595e
--- /dev/null
+++ b/tests/pending/run/t4788/C.scala
@@ -0,0 +1,2 @@
+@CAnnotation
+class C
diff --git a/tests/pending/run/t4788/CAnnotation.java b/tests/pending/run/t4788/CAnnotation.java
new file mode 100644
index 000000000..7120218d6
--- /dev/null
+++ b/tests/pending/run/t4788/CAnnotation.java
@@ -0,0 +1,5 @@
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
+@Retention(value=CLASS)
+@interface CAnnotation {}
diff --git a/tests/pending/run/t4788/D.scala b/tests/pending/run/t4788/D.scala
new file mode 100644
index 000000000..c2479fba8
--- /dev/null
+++ b/tests/pending/run/t4788/D.scala
@@ -0,0 +1,5 @@
+@Deprecated
+class DJava
+
+@deprecated("", "")
+class DScala
diff --git a/tests/pending/run/t4788/R.scala b/tests/pending/run/t4788/R.scala
new file mode 100644
index 000000000..ab0cd065d
--- /dev/null
+++ b/tests/pending/run/t4788/R.scala
@@ -0,0 +1,2 @@
+@RAnnotation
+class R
diff --git a/tests/pending/run/t4788/RAnnotation.java b/tests/pending/run/t4788/RAnnotation.java
new file mode 100644
index 000000000..f24cf66f7
--- /dev/null
+++ b/tests/pending/run/t4788/RAnnotation.java
@@ -0,0 +1,5 @@
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Retention(value=RUNTIME)
+@interface RAnnotation {}
diff --git a/tests/pending/run/t4788/S.scala b/tests/pending/run/t4788/S.scala
new file mode 100644
index 000000000..f8756d9bc
--- /dev/null
+++ b/tests/pending/run/t4788/S.scala
@@ -0,0 +1,2 @@
+@SAnnotation
+class S
diff --git a/tests/pending/run/t4788/SAnnotation.java b/tests/pending/run/t4788/SAnnotation.java
new file mode 100644
index 000000000..471f27d82
--- /dev/null
+++ b/tests/pending/run/t4788/SAnnotation.java
@@ -0,0 +1,5 @@
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+
+@Retention(value=SOURCE)
+@interface SAnnotation {}
diff --git a/tests/pending/run/t4788/Test.scala b/tests/pending/run/t4788/Test.scala
new file mode 100644
index 000000000..cbbb5ff38
--- /dev/null
+++ b/tests/pending/run/t4788/Test.scala
@@ -0,0 +1,35 @@
+import java.io.PrintWriter;
+
+import scala.tools.partest.BytecodeTest
+import scala.tools.asm.util._
+import scala.tools.nsc.util.stringFromWriter
+
+object Test extends BytecodeTest {
+ def annotationsForClass(className: String): Option[String] = {
+ val classNode = loadClassNode(className, skipDebugInfo = false)
+ val textifier = new Textifier
+ classNode.accept(new TraceClassVisitor(null, textifier, null))
+
+ val classString = stringFromWriter(w => textifier.print(w))
+ classString
+ .split('\n')
+ .filterNot(_.contains("@Lscala/reflect/ScalaSignature"))
+ .find(_.contains("@L"))
+ .map(_.trim)
+ }
+
+ def show {
+ // It seems like @java.lang.Deprecated shows up in both the
+ // Deprecated attribute and RuntimeVisibleAnnotation attribute,
+ // while @scala.deprecated only shows up in the Deprecated attribute.
+ // The check file just documents status quo, not sure if Scala
+ // should brought in line with Java or not...
+ // See the commit message and SI-8883 for more info.
+ println(annotationsForClass("DJava"))
+ println(annotationsForClass("DScala"))
+
+ println(annotationsForClass("S"))
+ println(annotationsForClass("C"))
+ println(annotationsForClass("R"))
+ }
+}