summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorDavid MacIver <david.maciver@gmail.com>2008-10-30 23:21:27 +0000
committerDavid MacIver <david.maciver@gmail.com>2008-10-30 23:21:27 +0000
commitbcbf5a12672f5b364c24398b6d98cd04ecb2e2be (patch)
tree6249bd524b6c0270db505f9698f6789a9c18ff62 /test/files
parent99529c51c054b3873442c5cbef34b81b84798434 (diff)
downloadscala-bcbf5a12672f5b364c24398b6d98cd04ecb2e2be.tar.gz
scala-bcbf5a12672f5b364c24398b6d98cd04ecb2e2be.tar.bz2
scala-bcbf5a12672f5b364c24398b6d98cd04ecb2e2be.zip
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.
Diffstat (limited to 'test/files')
-rw-r--r--test/files/jvm5/t1464.check1
-rw-r--r--test/files/jvm5/t1464/MyTrait.scala5
-rw-r--r--test/files/jvm5/t1464/Test.java6
-rw-r--r--test/files/pos5/chang/Outer.java11
-rw-r--r--test/files/pos5/chang/Test.scala3
-rw-r--r--test/files/pos5/ilya/J.java14
-rw-r--r--test/files/pos5/ilya/S.scala5
-rw-r--r--test/files/pos5/misc-pos.log4
-rw-r--r--test/files/pos5/t1101/J.java1
-rw-r--r--test/files/pos5/t1101/S.scala1
-rw-r--r--test/files/pos5/t1102/J.java4
-rw-r--r--test/files/pos5/t1102/S.scala1
-rw-r--r--test/files/pos5/t1150/J.java4
-rw-r--r--test/files/pos5/t1150/S.scala4
-rw-r--r--test/files/pos5/t1152/J.java1
-rw-r--r--test/files/pos5/t1152/S.scala2
-rw-r--r--test/files/pos5/t1176/J.java4
-rw-r--r--test/files/pos5/t1176/S.scala1
-rw-r--r--test/files/pos5/t1186.java8
-rw-r--r--test/files/pos5/t1196/J.java1
-rw-r--r--test/files/pos5/t1196/S.scala1
-rw-r--r--test/files/pos5/t1197/J.java2
-rw-r--r--test/files/pos5/t1197/S.scala2
-rw-r--r--test/files/pos5/t1203/J.java1
-rw-r--r--test/files/pos5/t1203/S.scala1
-rw-r--r--test/files/pos5/t1230/J.java1
-rw-r--r--test/files/pos5/t1230/S.scala1
-rw-r--r--test/files/pos5/t1231/J.java1
-rw-r--r--test/files/pos5/t1231/S.scala1
29 files changed, 80 insertions, 12 deletions
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<A> {
+
+ 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<T extends Foo>{}
+
+class Bar<BooT extends Boo<FooT>, 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<String> 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<String, String> 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) }