diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-09-02 12:51:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-02 12:51:08 +0200 |
commit | 50462a45dcbe91ef43652c235721b7a7ec0c8bb2 (patch) | |
tree | 1fdcdd15dfee8a49f38de80b5a265fb50d196723 /test/files/run | |
parent | f90bf565a529d0e95155992a3c243952183f25a5 (diff) | |
parent | 2277d37982bffb666b5c4bdb655d44234885e0bb (diff) | |
download | scala-50462a45dcbe91ef43652c235721b7a7ec0c8bb2.tar.gz scala-50462a45dcbe91ef43652c235721b7a7ec0c8bb2.tar.bz2 scala-50462a45dcbe91ef43652c235721b7a7ec0c8bb2.zip |
Merge pull request #5369 from lrytz/sd210
Fixes to mixin forwarders
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/junitForwarders/C_1.scala | 15 | ||||
-rw-r--r-- | test/files/run/junitForwarders/Test.java | 10 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/files/run/junitForwarders/C_1.scala b/test/files/run/junitForwarders/C_1.scala new file mode 100644 index 0000000000..2af2026a61 --- /dev/null +++ b/test/files/run/junitForwarders/C_1.scala @@ -0,0 +1,15 @@ +trait T { + @org.junit.Test def foo = 0 +} + +class C extends T + +object Test extends App { + def check(c: Class[_], e: String) = { + val s = c.getDeclaredMethods.sortBy(_.getName).map(m => s"${m.getName} - ${m.getDeclaredAnnotations.mkString(", ")}").mkString(";") + assert(s == e, s"found: $s\nexpected: $e") + } + check(classOf[C], "foo - @org.junit.Test()") + // TODO scala-dev#213: should `foo$` really carry the @Test annotation? + check(classOf[T], "$init$ - ;foo - @org.junit.Test();foo$ - @org.junit.Test()") +} diff --git a/test/files/run/junitForwarders/Test.java b/test/files/run/junitForwarders/Test.java new file mode 100644 index 0000000000..57c4d5b544 --- /dev/null +++ b/test/files/run/junitForwarders/Test.java @@ -0,0 +1,10 @@ +package org.junit; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD}) +public @interface Test { } |