summaryrefslogtreecommitdiff
path: root/test/files/run/junitForwarders/C_1.scala
blob: 0361ef42ef9f168a2dc10a8353be6a93fe0a4bcb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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()")
  // scala/scala-dev#213, scala/scala#5570: `foo$` should not have the @Test annotation
  check(classOf[T], "$init$ - ;foo - @org.junit.Test();foo$ - ")
}