summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/jvm/annotations.scala2
-rw-r--r--test/files/jvm/backendBugUnapply.scala9
-rw-r--r--test/files/jvm/bigints.scala6
-rw-r--r--test/files/jvm/manifests.scala2
-rw-r--r--test/files/jvm/serialization.check5
-rw-r--r--test/files/jvm/serialization.scala9
-rw-r--r--test/files/jvm/unittest_xml.scala7
-rw-r--r--test/files/neg/bug1845.scala2
-rw-r--r--test/files/neg/bug563.check2
-rw-r--r--test/files/neg/bug563.scala4
-rw-r--r--test/files/neg/migration28.check14
-rw-r--r--test/files/neg/migration28.scala5
-rw-r--r--test/files/neg/multi-array.check6
-rw-r--r--test/files/neg/multi-array.scala13
-rw-r--r--test/files/neg/t3115.check12
-rw-r--r--test/files/neg/t3115.flags1
-rwxr-xr-xtest/files/neg/t3115.scala9
-rw-r--r--test/files/neg/t3773.check4
-rw-r--r--test/files/neg/t3773.flags1
-rw-r--r--test/files/neg/t3773.scala5
-rw-r--r--test/files/pos/MailBox.scala3
-rw-r--r--test/files/pos/bug927.scala2
-rw-r--r--test/files/pos/depexists.scala2
-rw-r--r--test/files/pos/unapplyComplex.scala6
-rw-r--r--test/files/run/Course-2002-10.scala2
-rw-r--r--test/files/run/arrays.scala30
-rw-r--r--test/files/run/bug1044.scala2
-rw-r--r--test/files/run/bug1309.scala2
-rw-r--r--test/files/run/bug2005.scala2
-rw-r--r--test/files/run/indexedSeq-apply.check (renamed from test/files/run/randomAccessSeq-apply.check)0
-rw-r--r--test/files/run/indexedSeq-apply.scala (renamed from test/files/run/randomAccessSeq-apply.scala)6
-rw-r--r--test/files/run/iq.scala4
-rw-r--r--test/files/run/iterators.scala10
-rw-r--r--test/files/run/json.scala8
-rw-r--r--test/files/run/lists-run.scala14
-rw-r--r--test/files/run/map_java_conversions.scala2
-rw-r--r--test/files/run/multi-array.scala4
-rw-r--r--test/files/run/packrat1.scala2
-rw-r--r--test/files/run/packrat2.scala2
-rw-r--r--test/files/run/packrat3.scala2
-rw-r--r--test/files/run/repl-suppressed-warnings.check2
-rw-r--r--test/files/run/repl-suppressed-warnings.scala2
-rw-r--r--test/files/run/sort.scala12
-rw-r--r--test/files/run/stream_length.scala2
-rw-r--r--test/files/run/t0017.scala2
-rw-r--r--test/files/run/t0421.scala6
-rw-r--r--test/files/run/t0677.scala3
-rw-r--r--test/files/run/t2417.scala6
-rw-r--r--test/files/run/t2813.2.scala8
-rw-r--r--test/files/run/tailcalls.scala2
-rw-r--r--test/files/run/unapply.scala4
-rw-r--r--test/files/run/unittest_io.scala25
-rw-r--r--test/files/specialized/spec-matrix.scala2
53 files changed, 125 insertions, 174 deletions
diff --git a/test/files/jvm/annotations.scala b/test/files/jvm/annotations.scala
index f32eb625e9..740a74226e 100644
--- a/test/files/jvm/annotations.scala
+++ b/test/files/jvm/annotations.scala
@@ -110,7 +110,7 @@ object Test4 {
import java.lang.reflect.AnnotatedElement
def printSourceAnnotation(a: Annotation) {
val ann = a.asInstanceOf[SourceAnnotation]
- println("@test.SourceAnnotation(mails=" + ann.mails.deepMkString("{", ",", "}") +
+ println("@test.SourceAnnotation(mails=" + ann.mails.deep.mkString("{", ",", "}") +
", value=" + ann.value + ")")
}
def printSourceAnnotations(target: AnnotatedElement) {
diff --git a/test/files/jvm/backendBugUnapply.scala b/test/files/jvm/backendBugUnapply.scala
index 5461b72f91..b4d029f478 100644
--- a/test/files/jvm/backendBugUnapply.scala
+++ b/test/files/jvm/backendBugUnapply.scala
@@ -1,14 +1,11 @@
object Test {
- import scala.xml.{Node,HasKeyValue}
-
- def domatch(x:Node): Node = {
- val hasBar = new HasKeyValue("bar")
+ import scala.xml.{Node,UnprefixedAttribute}
+ def domatch(x:Node) =
x match {
- case Node("foo", hasBar(z), _*) => z
+ case Node("foo", UnprefixedAttribute("bar", z, _), _*) => z
case _ => null
}
- }
def main(args: Array[String]): Unit = {
println(domatch(<foo bar="baz"><hi/></foo>))
diff --git a/test/files/jvm/bigints.scala b/test/files/jvm/bigints.scala
index 4f6a06b7e1..f0d05f8b71 100644
--- a/test/files/jvm/bigints.scala
+++ b/test/files/jvm/bigints.scala
@@ -41,11 +41,11 @@ object Test_BigDecimal {
println("z <= 3 = " + (z <= 3))
println("3 < z = " + (3 < z))
- val a: BigDecimal= Math.MAX_LONG
+ val a: BigDecimal= Long.MaxValue
val b: BigDecimal = 1
val c = a - b
- println("c > MAX_LONG = " + (c > Math.MAX_LONG))
- println("c <= MAX_LONG = " + (c <= Math.MAX_LONG))
+ println("c > MAX_LONG = " + (c > Long.MaxValue))
+ println("c <= MAX_LONG = " + (c <= Long.MaxValue))
}
}
diff --git a/test/files/jvm/manifests.scala b/test/files/jvm/manifests.scala
index 8b6c00f9a5..6bbea4d052 100644
--- a/test/files/jvm/manifests.scala
+++ b/test/files/jvm/manifests.scala
@@ -70,7 +70,7 @@ object Test2 {
println()
def loadArray[T](x: Array[Byte])(implicit m: reflect.Manifest[Array[T]]) =
- load[Array[T]](x)(m).deepToString
+ load[Array[T]](x)(m).deep.toString
println("Array()="+loadArray[Int](dump(Array(): Array[Int])))
println("Array(true)="+loadArray[Boolean](dump(Array(true))))
println("Array(a)="+loadArray[Char](dump(Array('a'))))
diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization.check
index 0717de2a8e..8704bcc643 100644
--- a/test/files/jvm/serialization.check
+++ b/test/files/jvm/serialization.check
@@ -2,11 +2,6 @@ a1 = Array[1,2,3]
_a1 = Array[1,2,3]
arrayEquals(a1, _a1): true
-c1 = Cell(a)
-_c1 = Cell(a)
-c1 eq _c1: false, _c1 eq c1: false
-c1 equals _c1: true, _c1 equals c1: true
-
e1 = Left(1)
_e1 = Left(1)
e1 eq _e1: false, _e1 eq e1: false
diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization.scala
index 6a4e37bda9..1056f99848 100644
--- a/test/files/jvm/serialization.scala
+++ b/test/files/jvm/serialization.scala
@@ -56,15 +56,6 @@ object Test1_scala {
println("arrayEquals(a1, _a1): " + arrayEquals(a1, _a1))
println()
- // Cell
- val c1 = new Cell('a')
- val _c1: Cell[Char] = read(write(c1))
- println("c1 = " + c1)
- println("_c1 = " + _c1)
- println("c1 eq _c1: " + (c1 eq _c1) + ", _c1 eq c1: " + (_c1 eq c1))
- println("c1 equals _c1: " + (c1 equals _c1) + ", _c1 equals c1: " + (_c1 equals c1))
- println()
-
// Either
val e1 = Left(1)
val _e1: Either[Int, String] = read(write(e1))
diff --git a/test/files/jvm/unittest_xml.scala b/test/files/jvm/unittest_xml.scala
index e3d69115bc..7163ce2d88 100644
--- a/test/files/jvm/unittest_xml.scala
+++ b/test/files/jvm/unittest_xml.scala
@@ -9,17 +9,16 @@ object Test {
object MetaDataTest {
- import scala.xml.{ HasKeyValue, TopScope, NamespaceBinding, Node, Atom, Text }
+ import scala.xml.{ TopScope, NamespaceBinding, Node, Atom, Text }
def domatch(x:Node): Node = {
- val hasBar = new HasKeyValue("bar")
x match {
- //case Node("foo", hasBar(z), _*) => z
- case Node("foo", md, _*) if !hasBar.unapplySeq(md).isEmpty =>
+ case Node("foo", md @ UnprefixedAttribute(_, value, _), _*) if !value.isEmpty =>
md("bar")(0)
case _ => new Atom(3)
}
}
+
def run() {
var x: MetaData = Null
diff --git a/test/files/neg/bug1845.scala b/test/files/neg/bug1845.scala
index ceb43a0552..dab448b7dd 100644
--- a/test/files/neg/bug1845.scala
+++ b/test/files/neg/bug1845.scala
@@ -1,6 +1,6 @@
import scala.util.parsing.combinator.syntactical.TokenParsers
import scala.util.parsing.combinator.lexical.StdLexical
-import scala.util.parsing.syntax.StdTokens
+import scala.util.parsing.combinator.token._
class MyTokenParsers extends TokenParsers {
import lexical._
diff --git a/test/files/neg/bug563.check b/test/files/neg/bug563.check
index c10f504635..c592a56100 100644
--- a/test/files/neg/bug563.check
+++ b/test/files/neg/bug563.check
@@ -1,4 +1,4 @@
bug563.scala:6: error: missing parameter type
- map(n,ptr => new Cell(ptr.elem));
+ map(n,ptr => Option(ptr.get));
^
one error found
diff --git a/test/files/neg/bug563.scala b/test/files/neg/bug563.scala
index 624b83b1fa..204ad3cbdd 100644
--- a/test/files/neg/bug563.scala
+++ b/test/files/neg/bug563.scala
@@ -1,7 +1,7 @@
object Test {
def map[A,R](a : List[A], f : A => R) : List[R] = a.map(f);
- def split(sn : Iterable[List[Cell[Int]]]) : Unit =
+ def split(sn : Iterable[List[Option[Int]]]) : Unit =
for (n <- sn)
- map(n,ptr => new Cell(ptr.elem));
+ map(n,ptr => Option(ptr.get));
}
diff --git a/test/files/neg/migration28.check b/test/files/neg/migration28.check
index 4324cc0d0a..97146e88f7 100644
--- a/test/files/neg/migration28.check
+++ b/test/files/neg/migration28.check
@@ -1,8 +1,6 @@
-migration28.scala:5: error: method ++= in class Stack is deprecated: use pushAll
- s ++= List(1,2,3)
- ^
-migration28.scala:7: error: method foreach in class Stack has changed semantics:
-Stack iterator and foreach now traverse in FIFO order.
- s foreach (_ => ())
- ^
-two errors found
+migration28.scala:4: error: method scanRight in trait TraversableLike has changed semantics:
+This scanRight definition has changed in 2.9.
+The previous behavior can be reproduced with scanRight.reverse.
+ List(1,2,3,4,5).scanRight(0)(_+_)
+ ^
+one error found
diff --git a/test/files/neg/migration28.scala b/test/files/neg/migration28.scala
index 090b32d690..facc9b36d2 100644
--- a/test/files/neg/migration28.scala
+++ b/test/files/neg/migration28.scala
@@ -1,10 +1,7 @@
object Test {
import scala.collection.mutable._
- val s = new Stack[Int]
- s ++= List(1,2,3)
- s map (_ + 1)
- s foreach (_ => ())
+ List(1,2,3,4,5).scanRight(0)(_+_)
def main(args: Array[String]): Unit = {
diff --git a/test/files/neg/multi-array.check b/test/files/neg/multi-array.check
index f8432a76b8..511caa126f 100644
--- a/test/files/neg/multi-array.check
+++ b/test/files/neg/multi-array.check
@@ -1,8 +1,4 @@
-multi-array.scala:6: warning: new Array(...) with multiple dimensions has been deprecated; use Array.ofDim(...) instead
+multi-array.scala:7: error: too many arguments for constructor Array: (_length: Int)Array[T]
val a: Array[Int] = new Array(10, 10)
^
-multi-array.scala:6: error: too many dimensions for array creation
- val a: Array[Int] = new Array(10, 10)
- ^
-one warning found
one error found
diff --git a/test/files/neg/multi-array.scala b/test/files/neg/multi-array.scala
index 993a1c0865..b04e0fa0b1 100644
--- a/test/files/neg/multi-array.scala
+++ b/test/files/neg/multi-array.scala
@@ -1,7 +1,14 @@
-/** Check that a multi-dimensional array can't be created
- * when the wrong number of arguments w.r.t. to the array's
- * type is given.
+/** Multi-dimensional array creation with `new` was removed in 2.10.
+ * The replacement Array.ofDim[Int](10,10) makes the original mistake
+ * which was tested here impossible.
+ * This test will fail now because the constructor doesn't exist anymore.
*/
class Foo {
val a: Array[Int] = new Array(10, 10)
}
+
+//Before removal of constructor non-unary Array constructors:
+/** Check that a multi-dimensional array can't be created
+ * when the wrong number of arguments w.r.t. to the array's
+ * type is given.
+ */
diff --git a/test/files/neg/t3115.check b/test/files/neg/t3115.check
deleted file mode 100644
index c128ff5f3f..0000000000
--- a/test/files/neg/t3115.check
+++ /dev/null
@@ -1,12 +0,0 @@
-t3115.scala:6: error: object Math in object sc is deprecated:
- println(sc.Math)
- ^
-t3115.scala:7: error: object Math is deprecated: use the scala.math package object instead.
-(Example package object usage: scala.math.Pi )
- println(scala.Math)
- ^
-t3115.scala:8: error: object Math is deprecated: use the scala.math package object instead.
-(Example package object usage: scala.math.Pi )
- scala.Math.Pi
- ^
-three errors found
diff --git a/test/files/neg/t3115.flags b/test/files/neg/t3115.flags
deleted file mode 100644
index d1b831ea87..0000000000
--- a/test/files/neg/t3115.flags
+++ /dev/null
@@ -1 +0,0 @@
--deprecation -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t3115.scala b/test/files/neg/t3115.scala
deleted file mode 100755
index 3888085593..0000000000
--- a/test/files/neg/t3115.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-object sc {
- @deprecated("", "2.8.0") object Math
-}
-
-object Test {
- println(sc.Math)
- println(scala.Math)
- scala.Math.Pi
-}
diff --git a/test/files/neg/t3773.check b/test/files/neg/t3773.check
deleted file mode 100644
index ea0e866161..0000000000
--- a/test/files/neg/t3773.check
+++ /dev/null
@@ -1,4 +0,0 @@
-t3773.scala:3: error: method elements in trait IterableLike is deprecated: use `iterator` instead
- for ((v, t) <- m.elements) ()
- ^
-one error found
diff --git a/test/files/neg/t3773.flags b/test/files/neg/t3773.flags
deleted file mode 100644
index d1b831ea87..0000000000
--- a/test/files/neg/t3773.flags
+++ /dev/null
@@ -1 +0,0 @@
--deprecation -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t3773.scala b/test/files/neg/t3773.scala
deleted file mode 100644
index 3b92ed2d23..0000000000
--- a/test/files/neg/t3773.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-object t {
- val m = Map(1 -> "one")
- for ((v, t) <- m.elements) ()
-}
-
diff --git a/test/files/pos/MailBox.scala b/test/files/pos/MailBox.scala
index 67b923ea3e..8e27bd362d 100644
--- a/test/files/pos/MailBox.scala
+++ b/test/files/pos/MailBox.scala
@@ -1,8 +1,9 @@
package test;
-import scala.concurrent._;
+import scala.actors.TIMEOUT;
class MailBox {
+
private class LinkedList[a] {
var elem: a = _;
var next: LinkedList[a] = null;
diff --git a/test/files/pos/bug927.scala b/test/files/pos/bug927.scala
index 7d4c59d94c..c903f19867 100644
--- a/test/files/pos/bug927.scala
+++ b/test/files/pos/bug927.scala
@@ -5,7 +5,7 @@ object Test {
case Stream.Empty => 0
case Stream.cons(hd, tl) => hd + sum(tl)
}
- val str: Stream[Int] = Stream.fromIterator(List(1,2,3).iterator)
+ val str: Stream[Int] = List(1,2,3).iterator.toStream
assert(sum(str) == 6)
}
diff --git a/test/files/pos/depexists.scala b/test/files/pos/depexists.scala
index d539c844c1..dff1917a47 100644
--- a/test/files/pos/depexists.scala
+++ b/test/files/pos/depexists.scala
@@ -1,5 +1,5 @@
object depexists {
- val c: Cell[(a, b)] forSome { type a <: Number; type b <: (a, a) } = null
+ val c: Option[(a, b)] forSome { type a <: Number; type b <: (a, a) } = null
val d = c
}
diff --git a/test/files/pos/unapplyComplex.scala b/test/files/pos/unapplyComplex.scala
index 70158348c3..148fcc1bb6 100644
--- a/test/files/pos/unapplyComplex.scala
+++ b/test/files/pos/unapplyComplex.scala
@@ -14,14 +14,14 @@ object ComplexRect {
def unapply(z:Complex): Option[Complex] = {
if(z.isInstanceOf[ComplexRect]) Some(z) else z match {
case ComplexPolar(mod, arg) =>
- Some(new ComplexRect(mod*Math.cos(arg), mod*Math.sin(arg)))
+ Some(new ComplexRect(mod*math.cos(arg), mod*math.sin(arg)))
} } }
object ComplexPolar {
def unapply(z:Complex): Option[Complex] = {
if(z.isInstanceOf[ComplexPolar]) Some(z) else z match {
case ComplexRect(re,im) =>
- Some(new ComplexPolar(Math.sqrt(re*re + im*im), Math.atan(re/im)))
+ Some(new ComplexPolar(math.sqrt(re*re + im*im), math.atan(re/im)))
} } }
object Test {
@@ -31,7 +31,7 @@ object Test {
Console.println("mod"+mod+"arg"+arg)
}
val Komplex = ComplexRect
- new ComplexPolar(Math.sqrt(2),Math.Pi / 4.0) match {
+ new ComplexPolar(math.sqrt(2),math.Pi / 4.0) match {
case Komplex(re,im) => // z @ ???
Console.println("re"+re+" im"+im)
}
diff --git a/test/files/run/Course-2002-10.scala b/test/files/run/Course-2002-10.scala
index e978bc8258..4cfa1deb04 100644
--- a/test/files/run/Course-2002-10.scala
+++ b/test/files/run/Course-2002-10.scala
@@ -2,7 +2,7 @@
// Programmation IV - 2002 - Week 10
//############################################################################
-import Math.{Pi, log}
+import math.{Pi, log}
object M0 {
diff --git a/test/files/run/arrays.scala b/test/files/run/arrays.scala
index cd1cf13793..ecebc78a6f 100644
--- a/test/files/run/arrays.scala
+++ b/test/files/run/arrays.scala
@@ -167,41 +167,39 @@ object Test {
//##########################################################################
// Values
- import Math._
-
val u0: Unit = ();
val u1: Unit = ();
val z0: Boolean = false;
val z1: Boolean = true;
- val b0: Byte = MIN_BYTE;
+ val b0: Byte = Byte.MinValue;
val b1: Byte = 1;
- val b2: Byte = MAX_BYTE;
+ val b2: Byte = Byte.MaxValue;
- val s0: Short = MIN_SHORT;
+ val s0: Short = Short.MinValue;
val s1: Short = 2;
- val s2: Short = MAX_SHORT;
+ val s2: Short = Short.MaxValue;
- val c0: Char = MIN_CHAR;
+ val c0: Char = Char.MinValue;
val c1: Char = '3';
- val c2: Char = MAX_CHAR;
+ val c2: Char = Char.MaxValue;
- val i0: Int = MIN_INT;
+ val i0: Int = Int.MinValue;
val i1: Int = 4;
- val i2: Int = MAX_INT;
+ val i2: Int = Int.MinValue;
- val l0: Long = MIN_LONG;
+ val l0: Long = Long.MinValue;
val l1: Int = 5;
- val l2: Long = MAX_LONG;
+ val l2: Long = Long.MaxValue;
- val f0: Float = MIN_FLOAT;
+ val f0: Float = Float.MinValue;
val f1: Int = 6;
- val f2: Float = MAX_FLOAT;
+ val f2: Float = Float.MaxValue;
- val d0: Double = MIN_DOUBLE;
+ val d0: Double = Double.MinValue;
val d1: Int = 7;
- val d2: Double = MAX_DOUBLE;
+ val d2: Double = Double.MaxValue;
val a0: Unit = ();
val a1: Boolean = false;
diff --git a/test/files/run/bug1044.scala b/test/files/run/bug1044.scala
index 7ac5058607..4d37a40c81 100644
--- a/test/files/run/bug1044.scala
+++ b/test/files/run/bug1044.scala
@@ -1,4 +1,4 @@
object Test extends App {
val ducks = Array[AnyRef]("Huey", "Dewey", "Louie");
- ducks.elements.asInstanceOf[Iterator[String]]
+ ducks.iterator.asInstanceOf[Iterator[String]]
}
diff --git a/test/files/run/bug1309.scala b/test/files/run/bug1309.scala
index d753f4d96c..84963549a2 100644
--- a/test/files/run/bug1309.scala
+++ b/test/files/run/bug1309.scala
@@ -1,5 +1,5 @@
object Test {
- def f(ras: => RandomAccessSeq[Byte]): RandomAccessSeq[Byte] = ras
+ def f(ras: => IndexedSeq[Byte]): IndexedSeq[Byte] = ras
def main(args: Array[String]): Unit = {
f(new Array[Byte](0))
diff --git a/test/files/run/bug2005.scala b/test/files/run/bug2005.scala
index 4176709537..45da9fe5b2 100644
--- a/test/files/run/bug2005.scala
+++ b/test/files/run/bug2005.scala
@@ -1,6 +1,6 @@
object Test {
def main(args: Array[String]) {
- val a = new Array[Array[Int]](2,2)
+ val a = Array.ofDim[Int](2,2)
test(a)
}
def test[A](t: Array[Array[A]]) {
diff --git a/test/files/run/randomAccessSeq-apply.check b/test/files/run/indexedSeq-apply.check
index d86bac9de5..d86bac9de5 100644
--- a/test/files/run/randomAccessSeq-apply.check
+++ b/test/files/run/indexedSeq-apply.check
diff --git a/test/files/run/randomAccessSeq-apply.scala b/test/files/run/indexedSeq-apply.scala
index 9097038c51..39d4db2ce9 100644
--- a/test/files/run/randomAccessSeq-apply.scala
+++ b/test/files/run/indexedSeq-apply.scala
@@ -1,11 +1,11 @@
object Test extends App {
- val empty = RandomAccessSeq()
+ val empty = IndexedSeq()
assert(empty.isEmpty)
- val single = RandomAccessSeq(1)
+ val single = IndexedSeq(1)
assert(List(1) == single.toList)
- val two = RandomAccessSeq("a", "b")
+ val two = IndexedSeq("a", "b")
assert("a" == two.head)
assert("b" == two.apply(1))
diff --git a/test/files/run/iq.scala b/test/files/run/iq.scala
index 88a2884fcc..31859cf867 100644
--- a/test/files/run/iq.scala
+++ b/test/files/run/iq.scala
@@ -7,7 +7,7 @@ import scala.collection.immutable.Queue
object iq {
def main {
/* Create an empty queue. */
- val q: Queue[Int] = Queue.Empty
+ val q: Queue[Int] = Queue.empty
/* Test isEmpty.
* Expected: Empty
@@ -45,7 +45,7 @@ object iq {
*/
Console.println("q5[5]: " + q5(5))
- val q5c: Queue[Int] = Queue.Empty.enqueue(List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))
+ val q5c: Queue[Int] = Queue.empty.enqueue(List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))
/* Testing ==
* Expected: q5 == q9: true
diff --git a/test/files/run/iterators.scala b/test/files/run/iterators.scala
index 5f77289343..60eccdc8cc 100644
--- a/test/files/run/iterators.scala
+++ b/test/files/run/iterators.scala
@@ -75,11 +75,11 @@ object Test {
def check_fromArray: Int = { // ticket #429
val a = List(1, 2, 3, 4).toArray
- var xs0 = Iterator.fromArray(a).toList;
- var xs1 = Iterator.fromArray(a, 0, 1).toList;
- var xs2 = Iterator.fromArray(a, 0, 2).toList;
- var xs3 = Iterator.fromArray(a, 0, 3).toList;
- var xs4 = Iterator.fromArray(a, 0, 4).toList;
+ var xs0 = a.iterator.toList;
+ var xs1 = a.slice(0, 1).iterator.toList;
+ var xs2 = a.slice(0, 2).iterator.toList;
+ var xs3 = a.slice(0, 3).iterator.toList;
+ var xs4 = a.slice(0, 4).iterator.toList;
xs0.length + xs1.length + xs2.length + xs3.length + xs4.length
}
diff --git a/test/files/run/json.scala b/test/files/run/json.scala
index 7b2b80718c..8ee8c347fd 100644
--- a/test/files/run/json.scala
+++ b/test/files/run/json.scala
@@ -7,8 +7,8 @@ object Test extends App {
* toString comparison. */
def jsonToString(in : Any) : String = in match {
case l : List[_] => "[" + l.map(jsonToString).mkString(", ") + "]"
- case m : Map[String,_] => "{" + m.elements.toList
- .sort({ (x,y) => x._1 < y._1 })
+ case m : Map[String,_] => "{" + m.iterator.toList
+ .sortWith({ (x,y) => x._1 < y._1 })
.map({ case (k,v) => "\"" + k + "\": " + jsonToString(v) })
.mkString(", ") + "}"
case s : String => "\"" + s + "\""
@@ -20,7 +20,7 @@ object Test extends App {
*/
def sortJSON(in : Any) : Any = in match {
case l : List[_] => l.map(sortJSON)
- case m : Map[String,_] => TreeMap(m.mapElements(sortJSON).elements.toSeq : _*)
+ case m : Map[String,_] => TreeMap(m.mapValues(sortJSON).iterator.toSeq : _*)
// For the object versions, sort their contents, ugly casts and all...
case JSONObject(data) => JSONObject(sortJSON(data).asInstanceOf[Map[String,Any]])
case JSONArray(data) => JSONArray(sortJSON(data).asInstanceOf[List[Any]])
@@ -62,7 +62,7 @@ object Test extends App {
def stringDiff (expected : String, actual : String) {
if (expected != actual) {
// Figure out where the Strings differ and generate a marker
- val mismatchPosition = expected.toList.zip(actual.toList).findIndexOf({case (x,y) => x != y}) match {
+ val mismatchPosition = expected.toList.zip(actual.toList).indexWhere({case (x,y) => x != y}) match {
case -1 => Math.min(expected.length, actual.length)
case x => x
}
diff --git a/test/files/run/lists-run.scala b/test/files/run/lists-run.scala
index 9e9e49e818..13fca22982 100644
--- a/test/files/run/lists-run.scala
+++ b/test/files/run/lists-run.scala
@@ -25,7 +25,7 @@ object Test_multiset {
assert(List(1, 2) == (ys intersect xs), "ys_intersect_xs")
assert(List(1) == (xs diff ys), "xs_diff_ys")
assert(List(2, 3) == (ys diff xs), "ys_diff_xs")
- assert(isSubListOf(xs -- ys, xs diff ys), "xs_subset_ys")
+ assert(isSubListOf(xs filterNot (ys contains), xs diff ys), "xs_subset_ys")
val zs = List(0, 1, 1, 2, 2, 2)
assert(List(0, 1, 1, 2, 2, 2, 1, 2, 2, 3) == (zs union ys), "zs_union_ys")
@@ -34,7 +34,7 @@ object Test_multiset {
assert(List(1, 2, 2) == (ys intersect zs), "ys_intersect_zs")
assert(List(0, 1, 2) == (zs diff ys), "zs_diff_ys")
assert(List(3) == (ys diff zs), "ys_diff_zs")
- assert(isSubListOf(zs -- ys, zs diff ys), "xs_subset_ys")
+ assert(isSubListOf(zs filterNot (ys contains), zs diff ys), "xs_subset_ys")
val ws = List(2)
assert(List(2, 1, 2, 2, 3) == (ws union ys), "ws_union_ys")
@@ -43,7 +43,7 @@ object Test_multiset {
assert(List(2) == (ys intersect ws), "ys_intersect_ws")
assert(List() == (ws diff ys), "ws_diff_ys")
assert(List(1, 2, 3) == (ys diff ws), "ys_diff_ws")
- assert(isSubListOf(ws -- ys, ws diff ys), "ws_subset_ys")
+ assert(isSubListOf(ws filterNot (ys contains), ws diff ys), "ws_subset_ys")
val vs = List(3, 2, 2, 1)
assert(List(1, 1, 2, 3, 2, 2, 1) == (xs union vs), "xs_union_vs")
@@ -52,11 +52,11 @@ object Test_multiset {
assert(List(2, 1) == (vs intersect xs), "vs_intersect_xs")
assert(List(1) == (xs diff vs), "xs_diff_vs")
assert(List(3, 2) == (vs diff xs), "vs_diff_xs")
- assert(isSubListOf(xs -- vs, xs diff vs), "xs_subset_vs")
+ assert(isSubListOf(xs filterNot (vs contains), xs diff vs), "xs_subset_vs")
// tests adapted from Thomas Jung
assert({
- def sort(zs: List[Int]) = zs sort ( _ > _ )
+ def sort(zs: List[Int]) = zs sortWith ( _ > _ )
sort(xs intersect ys) == sort(ys intersect xs)
}, "be symmetric after sorting")
assert({
@@ -137,12 +137,12 @@ object Test2 {
val ys1 = xs1 ::: List(4)
assert(List(1, 2, 3, 4) == ys1, "check_:::")
- val ys2 = ys1 - 4
+ val ys2 = ys1 filterNot (_ == 4)
assert(xs1 == ys2, "check_-")
val n2 = (xs1 ++ ys1).length
val n3 = (xs1 ++ Nil).length
- val n4 = (xs1 ++ ((new collection.mutable.ArrayBuffer[Int]) + 0)).length
+ val n4 = (xs1 ++ ((new collection.mutable.ArrayBuffer[Int]) += 0)).length
assert(14 == n2 + n3 + n4, "check_++")
}
}
diff --git a/test/files/run/map_java_conversions.scala b/test/files/run/map_java_conversions.scala
index 4f9f8a915a..a41fae3695 100644
--- a/test/files/run/map_java_conversions.scala
+++ b/test/files/run/map_java_conversions.scala
@@ -19,7 +19,7 @@ object Test {
val concMap = new java.util.concurrent.ConcurrentHashMap[String, String]
test(concMap)
- val cmap = asConcurrentMap(concMap)
+ val cmap = asScalaConcurrentMap(concMap)
cmap.putIfAbsent("absentKey", "absentValue")
cmap.put("somekey", "somevalue")
assert(cmap.remove("somekey", "somevalue") == true)
diff --git a/test/files/run/multi-array.scala b/test/files/run/multi-array.scala
index 4f3a8d305f..36e21ae539 100644
--- a/test/files/run/multi-array.scala
+++ b/test/files/run/multi-array.scala
@@ -1,6 +1,6 @@
object Test extends App {
val a = Array(1, 2, 3)
- println(a.deepToString)
+ println(a.deep.toString)
val aaiIncomplete = new Array[Array[Array[Int]]](3)
println(aaiIncomplete(0))
@@ -9,6 +9,6 @@ object Test extends App {
println(aaiComplete.deep)
for (i <- 0 until 3; j <- 0 until 3)
aaiComplete(i)(j) = i + j
- println(aaiComplete.deepToString)
+ println(aaiComplete.deep.toString)
assert(aaiComplete.last.last == 4)
}
diff --git a/test/files/run/packrat1.scala b/test/files/run/packrat1.scala
index 3c3ea07afb..31a1ea55e5 100644
--- a/test/files/run/packrat1.scala
+++ b/test/files/run/packrat1.scala
@@ -2,7 +2,7 @@ import scala.util.parsing.combinator._
import scala.util.parsing.combinator.syntactical.StandardTokenParsers
import scala.util.parsing.input._
-import scala.util.parsing.syntax._
+import scala.util.parsing.combinator.token._
import scala.collection.mutable.HashMap
diff --git a/test/files/run/packrat2.scala b/test/files/run/packrat2.scala
index c25e5e9a85..b91a2eae46 100644
--- a/test/files/run/packrat2.scala
+++ b/test/files/run/packrat2.scala
@@ -2,7 +2,7 @@ import scala.util.parsing.combinator._
import scala.util.parsing.combinator.syntactical.StandardTokenParsers
import scala.util.parsing.input._
-import scala.util.parsing.syntax._
+import scala.util.parsing.combinator.token._
import scala.collection.mutable.HashMap
diff --git a/test/files/run/packrat3.scala b/test/files/run/packrat3.scala
index 3820f05158..8eab8ec6d0 100644
--- a/test/files/run/packrat3.scala
+++ b/test/files/run/packrat3.scala
@@ -2,7 +2,7 @@ import scala.util.parsing.combinator._
import scala.util.parsing.combinator.syntactical.StandardTokenParsers
import scala.util.parsing.input._
-import scala.util.parsing.syntax._
+import scala.util.parsing.combinator.token._
import scala.collection.mutable.HashMap
diff --git a/test/files/run/repl-suppressed-warnings.check b/test/files/run/repl-suppressed-warnings.check
index a8ab9296c0..ef9e5c1270 100644
--- a/test/files/run/repl-suppressed-warnings.check
+++ b/test/files/run/repl-suppressed-warnings.check
@@ -34,7 +34,7 @@ scala> object o {
@serializable case class Heyooooo
@deprecated("I'm an ironic deprecation warning") def f0 = 5 // where's this disappearing?
- def f1 = scala.Math.Pi // and this?
+ def f1 = Double.Epsilon // and this?
}
warning: there were 6 deprecation warnings; re-run with -deprecation for details
warning: there were 3 unchecked warnings; re-run with -unchecked for details
diff --git a/test/files/run/repl-suppressed-warnings.scala b/test/files/run/repl-suppressed-warnings.scala
index 2d96a8eb24..a79131fb2f 100644
--- a/test/files/run/repl-suppressed-warnings.scala
+++ b/test/files/run/repl-suppressed-warnings.scala
@@ -23,7 +23,7 @@ object o {
@serializable case class Heyooooo
@deprecated("I'm an ironic deprecation warning") def f0 = 5 // where's this disappearing?
- def f1 = scala.Math.Pi // and this?
+ def f1 = Double.Epsilon // and this?
}
:warnings
diff --git a/test/files/run/sort.scala b/test/files/run/sort.scala
index b89ff22f54..eea3a2d645 100644
--- a/test/files/run/sort.scala
+++ b/test/files/run/sort.scala
@@ -1,9 +1,9 @@
object Test extends App {
- println((1 to 100000).toList.sort(_<_).length)
- println(List(1, 5, 10, 3, 2).toList.sort(_<_))
- println(List(1, 5, 10, 3, 2).toList.sort(_>_))
- println(List(10).toList.sort(_<_))
- println(List(10,9).toList.sort(_<_))
- println(List[Int]().toList.sort(_<_))
+ println((1 to 100000).toList.sortWith(_<_).length)
+ println(List(1, 5, 10, 3, 2).toList.sortWith(_<_))
+ println(List(1, 5, 10, 3, 2).toList.sortWith(_>_))
+ println(List(10).toList.sortWith(_<_))
+ println(List(10,9).toList.sortWith(_<_))
+ println(List[Int]().toList.sortWith(_<_))
}
diff --git a/test/files/run/stream_length.scala b/test/files/run/stream_length.scala
index 68e9cad5ac..2808fbc495 100644
--- a/test/files/run/stream_length.scala
+++ b/test/files/run/stream_length.scala
@@ -5,7 +5,7 @@ object Test {
if (depth == 0)
Stream(bias)
else {
- Stream.concat(Stream.range(1, 100).map((x: Int) => walk(depth-1, bias + x)))
+ (Stream.iterate(1, 99)(_+1).map((x: Int) => walk(depth-1, bias + x))).flatten
}
}
diff --git a/test/files/run/t0017.scala b/test/files/run/t0017.scala
index e2a43a66ac..245cbb7e42 100644
--- a/test/files/run/t0017.scala
+++ b/test/files/run/t0017.scala
@@ -12,6 +12,6 @@ for (i <- Array.range(0, my_arr(0).length)) yield
val transposed = transpose(my_arr)
-println(transposed.deepToString)
+println(transposed.deep.toString)
}
diff --git a/test/files/run/t0421.scala b/test/files/run/t0421.scala
index 90adb31c4f..62be08c0fe 100644
--- a/test/files/run/t0421.scala
+++ b/test/files/run/t0421.scala
@@ -22,9 +22,9 @@ object Test extends App {
}
val a1 = Array(Array(0, 2, 4), Array(1, 3, 5))
- println(transpose(a1).deepMkString("[", ",", "]"))
+ println(transpose(a1).deep.mkString("[", ",", "]"))
- println(matmul(Array(Array(2, 3)), Array(Array(5), Array(7))).deepMkString("[", ",", "]"))
+ println(matmul(Array(Array(2, 3)), Array(Array(5), Array(7))).deep.mkString("[", ",", "]"))
- println(matmul(Array(Array(4)), Array(Array(6, 8))).deepMkString("[", ",", "]"))
+ println(matmul(Array(Array(4)), Array(Array(6, 8))).deep.mkString("[", ",", "]"))
}
diff --git a/test/files/run/t0677.scala b/test/files/run/t0677.scala
index 65448ed42c..131fcc24a6 100644
--- a/test/files/run/t0677.scala
+++ b/test/files/run/t0677.scala
@@ -1,7 +1,6 @@
object Test extends App {
class X[T: ClassManifest] {
- val a = new Array[Array[T]](3,4)
- val b = Array.ofDim[T](3, 4)
+ val a = Array.ofDim[T](3, 4)
}
val x = new X[String]
x.a(1)(2) = "hello"
diff --git a/test/files/run/t2417.scala b/test/files/run/t2417.scala
index 31d4c143fa..6200e33025 100644
--- a/test/files/run/t2417.scala
+++ b/test/files/run/t2417.scala
@@ -3,7 +3,7 @@ object Test {
def parallel(numThreads: Int)(block: => Unit) {
var failure: Throwable = null
- val threads = Array.fromFunction(i => new Thread {
+ val threads = Array.tabulate(numThreads)(i => new Thread {
override def run {
try {
block
@@ -11,7 +11,7 @@ object Test {
case x => failure = x
}
}
- })(numThreads)
+ })
for (t <- threads) t.start
for (t <- threads) t.join
if (failure != null) println("FAILURE: " + failure)
@@ -74,4 +74,4 @@ object Test {
testSet(5, 2, 1000000)
println()
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t2813.2.scala b/test/files/run/t2813.2.scala
index 9a9a79da4d..f41f6451f4 100644
--- a/test/files/run/t2813.2.scala
+++ b/test/files/run/t2813.2.scala
@@ -15,20 +15,20 @@ object Test extends App {
}
def addAllOfNonCollectionWrapperAtZeroOnLinkedList() {
- val l = new LinkedList[Int] + 1 + 2
+ val l = new LinkedList[Int] += 1 += 2
l.addAll(0, List(10, 11))
assertListEquals((List(10, 11, 1, 2)), l)
}
def addAllOfCollectionWrapperAtZeroOnLinkedList() {
- val l = new LinkedList[Int] + 1 + 2
- l.addAll(0, new LinkedList[Int] + 10 + 11)
+ val l = new LinkedList[Int] += 1 += 2
+ l.addAll(0, new LinkedList[Int] += 10 += 11)
assertListEquals((List(10, 11, 1, 2)), l)
}
def addAllOfCollectionWrapperAtZeroOnEmptyLinkedList() {
val l = new LinkedList[Int]
- l.addAll(0, new LinkedList[Int] + 10 + 11)
+ l.addAll(0, new LinkedList[Int] += 10 += 11)
assertListEquals((List(10, 11)), l)
}
diff --git a/test/files/run/tailcalls.scala b/test/files/run/tailcalls.scala
index 333ec7c402..77b123f5ce 100644
--- a/test/files/run/tailcalls.scala
+++ b/test/files/run/tailcalls.scala
@@ -295,7 +295,7 @@ object Test {
while (!stop) {
try {
calibrator.f(n, n);
- if (n >= Math.MAX_INT / 2) error("calibration failure");
+ if (n >= Int.MaxValue / 2) error("calibration failure");
n = 2 * n;
} catch {
case exception: compat.Platform.StackOverflowError => stop = true
diff --git a/test/files/run/unapply.scala b/test/files/run/unapply.scala
index 85c384ab1f..0c5a70e768 100644
--- a/test/files/run/unapply.scala
+++ b/test/files/run/unapply.scala
@@ -33,7 +33,7 @@ object VarFoo {
object Foo {
def unapply(x: Any): Option[Product2[Int, String]] = x match {
- case y: Bar => Some(Tuple(y.size, y.name))
+ case y: Bar => Some(y.size, y.name)
case _ => None
}
def doMatch1(b:Bar) = b match {
@@ -69,7 +69,7 @@ object Foo {
object Mas {
object Gaz {
def unapply(x: Any): Option[Product2[Int, String]] = x match {
- case y: Baz => Some(Tuple(y.size, y.name))
+ case y: Baz => Some(y.size, y.name)
case _ => None
}
}
diff --git a/test/files/run/unittest_io.scala b/test/files/run/unittest_io.scala
index 4d2869ec3b..2cadb9b1df 100644
--- a/test/files/run/unittest_io.scala
+++ b/test/files/run/unittest_io.scala
@@ -6,20 +6,25 @@ object Test {
}
object UTF8Tests {
- import io.UTF8Codec.encode
+ def decode(ch: Int) = new String(Array(ch), 0, 1).getBytes("UTF-8")
+
def run() {
- assert(new String( encode(0x004D), "utf8") == new String(Array(0x004D.asInstanceOf[Char])))
- assert(new String( encode(0x0430), "utf8") == new String(Array(0x0430.asInstanceOf[Char])))
- assert(new String( encode(0x4E8C), "utf8") == new String(Array(0x4E8C.asInstanceOf[Char])))
- assert(new String(encode(0x10302), "utf8") == new String(Array(0xD800.asInstanceOf[Char],
+ assert(new String( decode(0x004D), "utf8") == new String(Array(0x004D.asInstanceOf[Char])))
+ assert(new String( decode(0x0430), "utf8") == new String(Array(0x0430.asInstanceOf[Char])))
+ assert(new String( decode(0x4E8C), "utf8") == new String(Array(0x4E8C.asInstanceOf[Char])))
+ assert(new String(decode(0x10302), "utf8") == new String(Array(0xD800.asInstanceOf[Char],
0xDF02.asInstanceOf[Char])))
// a client
val test = "{\"a\":\"\\u0022\"}"
- val Expected = ("a","\"")
- assert(scala.util.parsing.json.JSON.parse(test) match {
- case Some(List(Expected)) => true
- case z => Console.println(z); false
- })
+ val expected = "a" -> "\""
+
+ val parsed = scala.util.parsing.json.JSON.parseFull(test)
+ val result = parsed == Some(Map(expected))
+ if(result)
+ assert(result)
+ else {
+ Console.println(parsed); assert(result)
+ }
}
}
diff --git a/test/files/specialized/spec-matrix.scala b/test/files/specialized/spec-matrix.scala
index fb3ac91481..463a454692 100644
--- a/test/files/specialized/spec-matrix.scala
+++ b/test/files/specialized/spec-matrix.scala
@@ -2,7 +2,7 @@
*/
class Matrix[@specialized A: ClassManifest](val rows: Int, val cols: Int) {
- private val arr: Array[Array[A]] = new Array[Array[A]](rows, cols)
+ private val arr: Array[Array[A]] = Array.ofDim[A](rows, cols)
def apply(i: Int, j: Int): A = {
if (i < 0 || i >= rows || j < 0 || j >= cols)