diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2016-05-23 10:17:15 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2016-05-23 10:17:15 +1000 |
commit | 2e40aa5871859b9ab6bdc03d56a81746fa90b1e5 (patch) | |
tree | 44db43073e3d974fc5ced61de278abd45b8e1227 /test/junit/scala/lang/annotations/RunTest.scala | |
parent | a79b9b7220c87ba21b374eda25702c7bc446dc29 (diff) | |
parent | e26835c01254ecb4d9b4fa3a8bbe9c835f808a38 (diff) | |
download | scala-2e40aa5871859b9ab6bdc03d56a81746fa90b1e5.tar.gz scala-2e40aa5871859b9ab6bdc03d56a81746fa90b1e5.tar.bz2 scala-2e40aa5871859b9ab6bdc03d56a81746fa90b1e5.zip |
Merge pull request #5180 from lrytz/junit-pass
Clean up JUnit tests, make sure they pass without bootstrap [ci: last-only]
Diffstat (limited to 'test/junit/scala/lang/annotations/RunTest.scala')
-rw-r--r-- | test/junit/scala/lang/annotations/RunTest.scala | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/junit/scala/lang/annotations/RunTest.scala b/test/junit/scala/lang/annotations/RunTest.scala new file mode 100644 index 0000000000..0d9c0c4713 --- /dev/null +++ b/test/junit/scala/lang/annotations/RunTest.scala @@ -0,0 +1,32 @@ +package scala.lang.annotations + +import org.junit.Assert._ +import org.junit.Test +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 + +import scala.tools.testing.RunTesting + +@RunWith(classOf[JUnit4]) +class RunTest extends RunTesting { + import runner._ + + @Test + def annotationInfoNotErased(): Unit = { + val code = + """import javax.annotation.Resource + |import scala.annotation.meta.getter + |class C { + | type Rg = Resource @getter + | @(Resource @getter)(`type` = classOf[Int]) def a = 0 + | @Rg(`type` = classOf[Int]) def b = 0 + |} + |val c = classOf[C] + |def typeArg(meth: String) = c.getDeclaredMethod(meth).getDeclaredAnnotation(classOf[Resource]).`type` + |List("a", "b") map typeArg + |""".stripMargin + + val i = Integer.TYPE + assertEquals(run[List[Class[_]]](code), List(i, i)) + } +} |