From 89bacb9c25a58454ff1878e67f7ea07ffc8c269f Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Tue, 12 May 2015 18:30:53 +0200 Subject: Run tests as they were in scala. --- tests/pending/run/t8574.scala | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/pending/run/t8574.scala (limited to 'tests/pending/run/t8574.scala') diff --git a/tests/pending/run/t8574.scala b/tests/pending/run/t8574.scala new file mode 100644 index 000000000..8c23ada48 --- /dev/null +++ b/tests/pending/run/t8574.scala @@ -0,0 +1,27 @@ +import annotation._ + +@SerialVersionUID(42) @strictfp class Foo[@specialized(Int) T] extends Serializable { + def foo(t: T) = t +} + +object Test extends App { + def checkUID(cls: Class[_], expected: Long) = { + val actual = java.io.ObjectStreamClass.lookup(cls).getSerialVersionUID + assert(actual == expected, s"$actual != expected for ${cls}") + } + def checkStrictFp(cls: Class[_]) = { + import java.lang.reflect._ + for (m <- cls.getDeclaredMethods) { + val isStrict = Modifier.isStrict(m.getModifiers) + assert(isStrict, cls) + } + } + def check(x: AnyRef) { + checkUID(x.getClass, 42) + checkStrictFp(x.getClass) + } + + check(new Foo[String]) + check(new Foo[Int]) +} + -- cgit v1.2.3