From bcbf5a12672f5b364c24398b6d98cd04ecb2e2be Mon Sep 17 00:00:00 2001 From: David MacIver Date: Thu, 30 Oct 2008 23:21:27 +0000 Subject: Martin's tests for mixed Scala/Java. A couple things are in pending because of partest weirdness. As far as I can tell they work but partest is doing the wrong thing with them. I'll open a ticket. --- test/files/jvm5/t1464.check | 1 - test/files/jvm5/t1464/MyTrait.scala | 5 ----- test/files/jvm5/t1464/Test.java | 6 ------ test/files/pos5/chang/Outer.java | 11 +++++++++++ test/files/pos5/chang/Test.scala | 3 +++ test/files/pos5/ilya/J.java | 14 ++++++++++++++ test/files/pos5/ilya/S.scala | 5 +++++ test/files/pos5/misc-pos.log | 4 ++++ test/files/pos5/t1101/J.java | 1 + test/files/pos5/t1101/S.scala | 1 + test/files/pos5/t1102/J.java | 4 ++++ test/files/pos5/t1102/S.scala | 1 + test/files/pos5/t1150/J.java | 4 ++++ test/files/pos5/t1150/S.scala | 4 ++++ test/files/pos5/t1152/J.java | 1 + test/files/pos5/t1152/S.scala | 2 ++ test/files/pos5/t1176/J.java | 4 ++++ test/files/pos5/t1176/S.scala | 1 + test/files/pos5/t1186.java | 8 ++++++++ test/files/pos5/t1196/J.java | 1 + test/files/pos5/t1196/S.scala | 1 + test/files/pos5/t1197/J.java | 2 ++ test/files/pos5/t1197/S.scala | 2 ++ test/files/pos5/t1203/J.java | 1 + test/files/pos5/t1203/S.scala | 1 + test/files/pos5/t1230/J.java | 1 + test/files/pos5/t1230/S.scala | 1 + test/files/pos5/t1231/J.java | 1 + test/files/pos5/t1231/S.scala | 1 + 29 files changed, 80 insertions(+), 12 deletions(-) delete mode 100644 test/files/jvm5/t1464.check delete mode 100644 test/files/jvm5/t1464/MyTrait.scala delete mode 100644 test/files/jvm5/t1464/Test.java create mode 100644 test/files/pos5/chang/Outer.java create mode 100644 test/files/pos5/chang/Test.scala create mode 100644 test/files/pos5/ilya/J.java create mode 100644 test/files/pos5/ilya/S.scala create mode 100644 test/files/pos5/misc-pos.log create mode 100644 test/files/pos5/t1101/J.java create mode 100644 test/files/pos5/t1101/S.scala create mode 100644 test/files/pos5/t1102/J.java create mode 100644 test/files/pos5/t1102/S.scala create mode 100644 test/files/pos5/t1150/J.java create mode 100644 test/files/pos5/t1150/S.scala create mode 100644 test/files/pos5/t1152/J.java create mode 100644 test/files/pos5/t1152/S.scala create mode 100644 test/files/pos5/t1176/J.java create mode 100644 test/files/pos5/t1176/S.scala create mode 100644 test/files/pos5/t1186.java create mode 100644 test/files/pos5/t1196/J.java create mode 100644 test/files/pos5/t1196/S.scala create mode 100644 test/files/pos5/t1197/J.java create mode 100644 test/files/pos5/t1197/S.scala create mode 100644 test/files/pos5/t1203/J.java create mode 100644 test/files/pos5/t1203/S.scala create mode 100644 test/files/pos5/t1230/J.java create mode 100644 test/files/pos5/t1230/S.scala create mode 100644 test/files/pos5/t1231/J.java create mode 100644 test/files/pos5/t1231/S.scala (limited to 'test/files') diff --git a/test/files/jvm5/t1464.check b/test/files/jvm5/t1464.check deleted file mode 100644 index c508d5366f..0000000000 --- a/test/files/jvm5/t1464.check +++ /dev/null @@ -1 +0,0 @@ -false diff --git a/test/files/jvm5/t1464/MyTrait.scala b/test/files/jvm5/t1464/MyTrait.scala deleted file mode 100644 index 0b8ccc412b..0000000000 --- a/test/files/jvm5/t1464/MyTrait.scala +++ /dev/null @@ -1,5 +0,0 @@ -trait MyTrait { - type K - def findChildByClass[T <: K with MyTrait]: Unit - -} diff --git a/test/files/jvm5/t1464/Test.java b/test/files/jvm5/t1464/Test.java deleted file mode 100644 index 235848b1df..0000000000 --- a/test/files/jvm5/t1464/Test.java +++ /dev/null @@ -1,6 +0,0 @@ -public class Test { - public static void main(String[] args) { - Object o = new Object(); - System.out.println(o instanceof MyTrait); - } -} diff --git a/test/files/pos5/chang/Outer.java b/test/files/pos5/chang/Outer.java new file mode 100644 index 0000000000..acdb4e2904 --- /dev/null +++ b/test/files/pos5/chang/Outer.java @@ -0,0 +1,11 @@ +package com.netgents.hello; + +public class Outer { + + public Inner inner = new Inner(); + + public class Inner { + + public A a; + } +} diff --git a/test/files/pos5/chang/Test.scala b/test/files/pos5/chang/Test.scala new file mode 100644 index 0000000000..9bb745e377 --- /dev/null +++ b/test/files/pos5/chang/Test.scala @@ -0,0 +1,3 @@ +object Test extends Application { + new com.netgents.hello.Outer[String] +} diff --git a/test/files/pos5/ilya/J.java b/test/files/pos5/ilya/J.java new file mode 100644 index 0000000000..c44169ca1b --- /dev/null +++ b/test/files/pos5/ilya/J.java @@ -0,0 +1,14 @@ +package test; + +class Foo { +} + +class Boo{} + +class Bar, FooT extends Foo>{ + private final int myInt; + + public Bar(int i) { + myInt = i; + } +} \ No newline at end of file diff --git a/test/files/pos5/ilya/S.scala b/test/files/pos5/ilya/S.scala new file mode 100644 index 0000000000..952c004ccc --- /dev/null +++ b/test/files/pos5/ilya/S.scala @@ -0,0 +1,5 @@ +package test + +class ScBar[BooT <: Boo[FooT], FooT <: Foo](i: Int) extends Bar[BooT, FooT](i) { + +} diff --git a/test/files/pos5/misc-pos.log b/test/files/pos5/misc-pos.log new file mode 100644 index 0000000000..b921dd4d64 --- /dev/null +++ b/test/files/pos5/misc-pos.log @@ -0,0 +1,4 @@ +A.java:3: error: illegal cyclic reference involving object A +import static test.A.STATE.UNDEF; + ^ +one error found diff --git a/test/files/pos5/t1101/J.java b/test/files/pos5/t1101/J.java new file mode 100644 index 0000000000..2bc1d53e09 --- /dev/null +++ b/test/files/pos5/t1101/J.java @@ -0,0 +1 @@ +class J { enum E { E1 } } diff --git a/test/files/pos5/t1101/S.scala b/test/files/pos5/t1101/S.scala new file mode 100644 index 0000000000..af7a591e58 --- /dev/null +++ b/test/files/pos5/t1101/S.scala @@ -0,0 +1 @@ +class S { val x: J.E = null; System.out.println(J.E.E1) } diff --git a/test/files/pos5/t1102/J.java b/test/files/pos5/t1102/J.java new file mode 100644 index 0000000000..530102b91c --- /dev/null +++ b/test/files/pos5/t1102/J.java @@ -0,0 +1,4 @@ +class J { + enum E { E1 } + void foo(E e) { } +} diff --git a/test/files/pos5/t1102/S.scala b/test/files/pos5/t1102/S.scala new file mode 100644 index 0000000000..9beee8d901 --- /dev/null +++ b/test/files/pos5/t1102/S.scala @@ -0,0 +1 @@ +class S(j:J) { j.foo(J.E.E1) } diff --git a/test/files/pos5/t1150/J.java b/test/files/pos5/t1150/J.java new file mode 100644 index 0000000000..68fa04a178 --- /dev/null +++ b/test/files/pos5/t1150/J.java @@ -0,0 +1,4 @@ +class J { + static void bbb (Boolean b) { } + static void ddd (Double d) { } +} diff --git a/test/files/pos5/t1150/S.scala b/test/files/pos5/t1150/S.scala new file mode 100644 index 0000000000..41dd064037 --- /dev/null +++ b/test/files/pos5/t1150/S.scala @@ -0,0 +1,4 @@ +object S { + J.bbb(new java.lang.Boolean(true)) + J.ddd(new java.lang.Double(0)) +} diff --git a/test/files/pos5/t1152/J.java b/test/files/pos5/t1152/J.java new file mode 100644 index 0000000000..6e562e573d --- /dev/null +++ b/test/files/pos5/t1152/J.java @@ -0,0 +1 @@ +class J { java.util.List k = null; } diff --git a/test/files/pos5/t1152/S.scala b/test/files/pos5/t1152/S.scala new file mode 100644 index 0000000000..7f751c5090 --- /dev/null +++ b/test/files/pos5/t1152/S.scala @@ -0,0 +1,2 @@ +class S2(fn:(J)=>Any) +object S { new S2(_.k) } diff --git a/test/files/pos5/t1176/J.java b/test/files/pos5/t1176/J.java new file mode 100644 index 0000000000..0d82c75fcb --- /dev/null +++ b/test/files/pos5/t1176/J.java @@ -0,0 +1,4 @@ +class J { + J() { } + J( java.util.Collection collection ) { } +} diff --git a/test/files/pos5/t1176/S.scala b/test/files/pos5/t1176/S.scala new file mode 100644 index 0000000000..a7fc3e0cea --- /dev/null +++ b/test/files/pos5/t1176/S.scala @@ -0,0 +1 @@ +class S { new J } diff --git a/test/files/pos5/t1186.java b/test/files/pos5/t1186.java new file mode 100644 index 0000000000..c1bfcecab8 --- /dev/null +++ b/test/files/pos5/t1186.java @@ -0,0 +1,8 @@ +import scala.collection.immutable.Map; + +class Test { + + void foo() { + Map map = null; + } +} \ No newline at end of file diff --git a/test/files/pos5/t1196/J.java b/test/files/pos5/t1196/J.java new file mode 100644 index 0000000000..2ec7a711bb --- /dev/null +++ b/test/files/pos5/t1196/J.java @@ -0,0 +1 @@ +class J { static void foo(Class c) { } } diff --git a/test/files/pos5/t1196/S.scala b/test/files/pos5/t1196/S.scala new file mode 100644 index 0000000000..f17cd249a7 --- /dev/null +++ b/test/files/pos5/t1196/S.scala @@ -0,0 +1 @@ +object S { J.foo(null) } diff --git a/test/files/pos5/t1197/J.java b/test/files/pos5/t1197/J.java new file mode 100644 index 0000000000..b4e0a4255c --- /dev/null +++ b/test/files/pos5/t1197/J.java @@ -0,0 +1,2 @@ +class J { interface K { } } + diff --git a/test/files/pos5/t1197/S.scala b/test/files/pos5/t1197/S.scala new file mode 100644 index 0000000000..7c9c15440f --- /dev/null +++ b/test/files/pos5/t1197/S.scala @@ -0,0 +1,2 @@ +object S extends J.K + diff --git a/test/files/pos5/t1203/J.java b/test/files/pos5/t1203/J.java new file mode 100644 index 0000000000..7fae118e04 --- /dev/null +++ b/test/files/pos5/t1203/J.java @@ -0,0 +1 @@ +interface J { int j = 200 ; } diff --git a/test/files/pos5/t1203/S.scala b/test/files/pos5/t1203/S.scala new file mode 100644 index 0000000000..68eac4bf6d --- /dev/null +++ b/test/files/pos5/t1203/S.scala @@ -0,0 +1 @@ +object S { J.j } diff --git a/test/files/pos5/t1230/J.java b/test/files/pos5/t1230/J.java new file mode 100644 index 0000000000..35aefd2505 --- /dev/null +++ b/test/files/pos5/t1230/J.java @@ -0,0 +1 @@ +class J { public int foo ; } diff --git a/test/files/pos5/t1230/S.scala b/test/files/pos5/t1230/S.scala new file mode 100644 index 0000000000..f8a691b6de --- /dev/null +++ b/test/files/pos5/t1230/S.scala @@ -0,0 +1 @@ +object S extends Application { (new J).foo = 5 } diff --git a/test/files/pos5/t1231/J.java b/test/files/pos5/t1231/J.java new file mode 100644 index 0000000000..1dfc9490eb --- /dev/null +++ b/test/files/pos5/t1231/J.java @@ -0,0 +1 @@ +enum J { j1 } \ No newline at end of file diff --git a/test/files/pos5/t1231/S.scala b/test/files/pos5/t1231/S.scala new file mode 100644 index 0000000000..ee08866e04 --- /dev/null +++ b/test/files/pos5/t1231/S.scala @@ -0,0 +1 @@ +object S extends Application { println(J.j1) } -- cgit v1.2.3