summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/jvm/serialization.check4
-rw-r--r--test/files/neg/specification-scopes.check12
-rw-r--r--test/files/neg/specification-scopes/P_1.scala6
-rw-r--r--test/files/neg/specification-scopes/P_2.scala21
-rw-r--r--test/files/neg/t3240.check5
-rw-r--r--test/files/pos/raw-map/J_1.java4
-rw-r--r--test/files/pos/raw-map/S_2.scala6
-rw-r--r--test/files/run/xml-attribute.check12
-rw-r--r--test/files/run/xml-attribute.scala24
9 files changed, 78 insertions, 16 deletions
diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization.check
index bc56387f81..f58f763a76 100644
--- a/test/files/jvm/serialization.check
+++ b/test/files/jvm/serialization.check
@@ -206,7 +206,7 @@ x equals y: true, y equals x: true
x = <html>
<body>
- <table cellspacing="0" cellpadding="2">
+ <table cellpadding="2" cellspacing="0">
<tr>
<th>Last Name</th>
<th>First Name</th>
@@ -226,7 +226,7 @@ x = <html>
</html>
y = <html>
<body>
- <table cellspacing="0" cellpadding="2">
+ <table cellpadding="2" cellspacing="0">
<tr>
<th>Last Name</th>
<th>First Name</th>
diff --git a/test/files/neg/specification-scopes.check b/test/files/neg/specification-scopes.check
new file mode 100644
index 0000000000..7af9842379
--- /dev/null
+++ b/test/files/neg/specification-scopes.check
@@ -0,0 +1,12 @@
+P_2.scala:14: error: reference to x is ambiguous;
+it is both defined in object C and imported subsequently by
+import Q.X._
+ println("L14: "+x) // reference to 'x' is ambiguous here
+ ^
+P_2.scala:19: error: reference to y is ambiguous;
+it is imported twice in the same scope by
+import P.X._
+and import X.y
+ println("L19: "+y) // reference to 'y' is ambiguous here
+ ^
+two errors found
diff --git a/test/files/neg/specification-scopes/P_1.scala b/test/files/neg/specification-scopes/P_1.scala
new file mode 100644
index 0000000000..3b11f1167d
--- /dev/null
+++ b/test/files/neg/specification-scopes/P_1.scala
@@ -0,0 +1,6 @@
+package P {
+ object X { val x = 1; val y = 2; }
+}
+package Q {
+ object X { val x = true; val y = "" }
+}
diff --git a/test/files/neg/specification-scopes/P_2.scala b/test/files/neg/specification-scopes/P_2.scala
new file mode 100644
index 0000000000..d59f82e90d
--- /dev/null
+++ b/test/files/neg/specification-scopes/P_2.scala
@@ -0,0 +1,21 @@
+package P { // 'X' bound by package clause
+ import Console._ // 'println' bound by wildcard import
+ object A {
+ println("L4: "+X) // 'X' refers to 'P.X' here
+ object B {
+ import Q._ // 'X' bound by wildcard import
+ println("L7: "+X) // 'X' refers to 'Q.X' here
+ import X._ // 'x' and 'y' bound by wildcard import
+ println("L8: "+x) // 'x' refers to 'Q.X.x' here
+ object C {
+ val x = 3 // 'x' bound by local definition
+ println("L12: "+x); // 'x' refers to constant '3' here
+ { import Q.X._ // 'x' and 'y' bound by wildcard
+ println("L14: "+x) // reference to 'x' is ambiguous here
+ import X.y // 'y' bound by explicit import
+ println("L16: "+y); // 'y' refers to 'Q.X.y' here
+ { val x = "abc" // 'x' bound by local definition
+ import P.X._ // 'x' and 'y' bound by wildcard
+ println("L19: "+y) // reference to 'y' is ambiguous here
+ println("L20: "+x) // 'x' refers to string ''abc'' here
+}}}}}}
diff --git a/test/files/neg/t3240.check b/test/files/neg/t3240.check
index 7ebabd5fcd..efae682c66 100644
--- a/test/files/neg/t3240.check
+++ b/test/files/neg/t3240.check
@@ -1,7 +1,4 @@
t3240.scala:3: error: only classes can have declared but undefined members
type t
^
-t3240.scala:5: error: type arguments [this.t] do not conform to method asInstanceOf's type parameter bounds [T0]
- a.getOrElse(defVal).asInstanceOf[t]
- ^
-two errors found
+one error found
diff --git a/test/files/pos/raw-map/J_1.java b/test/files/pos/raw-map/J_1.java
new file mode 100644
index 0000000000..bd43bcac81
--- /dev/null
+++ b/test/files/pos/raw-map/J_1.java
@@ -0,0 +1,4 @@
+public class J_1 {
+ public void setRawType(java.util.Map x) {
+ }
+}
diff --git a/test/files/pos/raw-map/S_2.scala b/test/files/pos/raw-map/S_2.scala
new file mode 100644
index 0000000000..de6c4ee5c2
--- /dev/null
+++ b/test/files/pos/raw-map/S_2.scala
@@ -0,0 +1,6 @@
+class Foo {
+ def foo {
+ val x: J_1 = null
+ x.setRawType(new java.util.HashMap)
+ }
+}
diff --git a/test/files/run/xml-attribute.check b/test/files/run/xml-attribute.check
new file mode 100644
index 0000000000..3ae2034684
--- /dev/null
+++ b/test/files/run/xml-attribute.check
@@ -0,0 +1,12 @@
+<t></t>
+<t></t>
+<t></t>
+<t></t>
+<t></t>
+<t b="1" d="2"></t>
+<t b="1" d="2"></t>
+<t b="1" d="2"></t>
+<t a="1" d="2"></t>
+<t b="1" d="2"></t>
+<t a="1" b="2" c="3"></t>
+<t g="1" e="2" p:a="3" f:e="4" mgruhu:ji="5"></t> \ No newline at end of file
diff --git a/test/files/run/xml-attribute.scala b/test/files/run/xml-attribute.scala
index 8b261acc94..eb3956c41b 100644
--- a/test/files/run/xml-attribute.scala
+++ b/test/files/run/xml-attribute.scala
@@ -12,12 +12,11 @@ object Test {
assert(noAttr == preAttrNull)
assert(noAttr == preAttrNone)
- val noAttrStr = "<t></t>"
- assert(noAttr.toString() == noAttrStr)
- assert(attrNull.toString() == noAttrStr)
- assert(attrNone.toString() == noAttrStr)
- assert(preAttrNull.toString() == noAttrStr)
- assert(preAttrNone.toString() == noAttrStr)
+ println(noAttr)
+ println(attrNull)
+ println(attrNone)
+ println(preAttrNull)
+ println(preAttrNone)
val xml1 = <t b="1" d="2"/>
val xml2 = <t a={ null: String } p:a={ null: String } b="1" c={ null: String } d="2"/>
@@ -25,9 +24,14 @@ object Test {
assert(xml1 == xml2)
assert(xml1 == xml3)
- val xml1Str = "<t d=\"2\" b=\"1\"></t>"
- assert(xml1.toString() == xml1Str)
- assert(xml2.toString() == xml1Str)
- assert(xml3.toString() == xml1Str)
+ println(xml1)
+ println(xml2)
+ println(xml3)
+
+ // Check if attribute order is retained
+ println(<t a="1" d="2"/>)
+ println(<t b="1" d="2"/>)
+ println(<t a="1" b="2" c="3"/>)
+ println(<t g="1" e="2" p:a="3" f:e="4" mgruhu:ji="5"/>)
}
}