diff options
author | Martin Odersky <odersky@gmail.com> | 2009-05-08 16:33:15 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-05-08 16:33:15 +0000 |
commit | 14a631a5fec42d04d0723355a0b93e482b5e4662 (patch) | |
tree | f639c2a22e89e193b9abea391993ecfd4d5326ee /test/files | |
parent | 2379eb4ebbd28c8892b50a1d9fa8a687099eea4d (diff) | |
download | scala-14a631a5fec42d04d0723355a0b93e482b5e4662.tar.gz scala-14a631a5fec42d04d0723355a0b93e482b5e4662.tar.bz2 scala-14a631a5fec42d04d0723355a0b93e482b5e4662.zip |
massive new collections checkin.
Diffstat (limited to 'test/files')
111 files changed, 68 insertions, 2144 deletions
diff --git a/test/files/jvm/manifests.check b/test/files/jvm/manifests.check index bfcd6a20eb..f8ef5b203c 100644 --- a/test/files/jvm/manifests.check +++ b/test/files/jvm/manifests.check @@ -5,11 +5,11 @@ x=1, m=int x=abc, m=java.lang.String x='abc, m=scala.Symbol -x=List(()), m=scala.List[void] -x=List(true), m=scala.List[boolean] -x=List(1), m=scala.List[int] -x=List(abc), m=scala.List[java.lang.String] -x=List('abc), m=scala.List[scala.Symbol] +x=List(()), m=scala.collection.immutable.List[void] +x=List(true), m=scala.collection.immutable.List[boolean] +x=List(1), m=scala.collection.immutable.List[int] +x=List(abc), m=scala.collection.immutable.List[java.lang.String] +x=List('abc), m=scala.collection.immutable.List[scala.Symbol] x=[Z, m=Array[boolean] x=[C, m=Array[char] @@ -24,12 +24,12 @@ x=(abc,xyz), m=scala.Tuple2[java.lang.String, java.lang.String] x=('abc,'xyz), m=scala.Tuple2[scala.Symbol, scala.Symbol] x=Test$, m=Test$ -x=scala.List$, m=scala.List$ +x=scala.collection.immutable.List$, m=scala.collection.immutable.List$ x=Foo, m=Foo[int] -x=Foo, m=Foo[scala.List[int]] +x=Foo, m=Foo[scala.collection.immutable.List[int]] x=Foo, m=Foo[Foo[int]] -x=Foo, m=Foo[scala.List[Foo[int]]] +x=Foo, m=Foo[scala.collection.immutable.List[Foo[int]]] x=Test1$$anon$1, m=Test1$$anon$1 diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization.check deleted file mode 100644 index d6782410c8..0000000000 --- a/test/files/jvm/serialization.check +++ /dev/null @@ -1,190 +0,0 @@ -x0 = List(1, 2, 3) -y0 = List(1, 2, 3) -x0 eq y0: false - y0 eq x0: false -x0 equals y0: true - y0 equals x0: true - -x1 = List() -y1 = List() -x1 eq y1: true - y1 eq x1: true - -x2 = None -y2 = None -x2 eq y2: true - y2 eq x2: true - -x3 = Array[1,2,3] -y3 = Array[1,2,3] -arrayEquals(x3, y3): true - -x4 = <na> -y4 = <na> -x4(2): 4 - y4(2): 4 - -x5 = 'hello -y5 = 'hello -x5 eq y5: true - y5 eq x5: true -x5 equals y5: true - y5 equals x5: true - -x6 = (BannerLimit,12345) -y6 = (BannerLimit,12345) -x6 eq y6: false - y6 eq x6: false -x6 equals y6: true - y6 equals x6: true - -x7 = {scala.BigDecimal$RoundingMode(0), scala.BigDecimal$RoundingMode(1), scala.BigDecimal$RoundingMode(2), scala.BigDecimal$RoundingMode(3), scala.BigDecimal$RoundingMode(4), scala.BigDecimal$RoundingMode(5), scala.BigDecimal$RoundingMode(6), scala.BigDecimal$RoundingMode(7)} -y7 = {scala.BigDecimal$RoundingMode(0), scala.BigDecimal$RoundingMode(1), scala.BigDecimal$RoundingMode(2), scala.BigDecimal$RoundingMode(3), scala.BigDecimal$RoundingMode(4), scala.BigDecimal$RoundingMode(5), scala.BigDecimal$RoundingMode(6), scala.BigDecimal$RoundingMode(7)} -x7 eq y7: true - y7 eq x7: true -x7 equals y7: true - y7 equals x7: true - -x8 = {Test1_scala$WeekDay(0), Test1_scala$WeekDay(1), Test1_scala$WeekDay(2), Test1_scala$WeekDay(3), Test1_scala$WeekDay(4), Test1_scala$WeekDay(5), Test1_scala$WeekDay(6)} -y8 = {Test1_scala$WeekDay(0), Test1_scala$WeekDay(1), Test1_scala$WeekDay(2), Test1_scala$WeekDay(3), Test1_scala$WeekDay(4), Test1_scala$WeekDay(5), Test1_scala$WeekDay(6)} -x8 eq y8: true - y8 eq x8: true -x8 equals y8: true - y8 equals x8: true - -x9 = scala.BigDecimal$RoundingMode(0) -y9 = scala.BigDecimal$RoundingMode(0) -x9 eq y9: true - y9 eq x9: true -x9 equals y9: true - y9 equals x9: true - -x10 = Test1_scala$WeekDay(0) -y10 = Test1_scala$WeekDay(0) -x10 eq y10: true - y10 eq x10: true -x10 equals y10: true - y10 equals x10: true - -x9 eq x10: false - x10 eq x9: false -x9 equals x10: false - x10 equals x9: false -x9 eq y10: false - y10 eq x9: false -x9 equals y10: false - y10 equals x9: false - -x = List((buffers,20), (layers,2), (title,3)) -y = List((buffers,20), (layers,2), (title,3)) -x equals y: true - y equals x: true - -x = Map(buffers -> 20, layers -> 2, title -> 3) -y = Map(buffers -> 20, layers -> 2, title -> 3) -x equals y: true - y equals x: true - -x = Set(2, 3) -y = Set(2, 3) -x equals y: true - y equals x: true - -x = Set(5, 3) -y = Set(5, 3) -x equals y: true - y equals x: true - -x = Queue(a, b, c) -y = Queue(a, b, c) -x equals y: true - y equals x: true - -x = Stack(a, b, c) -y = Stack(a, b, c) -x equals y: true - y equals x: true - -x = Map(42 -> FortyTwo) -y = Map(42 -> FortyTwo) -x equals y: true - y equals x: true - -x = Set(0, 2) -y = Set(0, 2) -x equals y: true - y equals x: true - -x = ArrayBuffer(one, two) -y = ArrayBuffer(one, two) -x equals y: true - y equals x: true - -x = Map(title -> 3, buffers -> 20, layers -> 2) -y = Map(title -> 3, buffers -> 20, layers -> 2) -x equals y: true - y equals x: true - -x = Set(0, 8, 9) -y = Set(0, 8, 9) -x equals y: true - y equals x: true - -x = Set(layers, buffers, title) -y = Set(layers, buffers, title) -x equals y: true - y equals x: true - -x = LinkedList(2, 3) -y = LinkedList(2, 3) -x equals y: true - y equals x: true - -x = Queue(20, 2, 3) -y = Queue(20, 2, 3) -x equals y: true - y equals x: true - -x = Stack(20, 2, 3) -y = Stack(20, 2, 3) -x equals y: true - y equals x: true - -x = ListBuffer(white, black) -y = ListBuffer(white, black) -x equals y: true - y equals x: true - -x = <html><title>title</title><body/></html> -y = <html><title>title</title><body/></html> -x equals y: true - y equals x: true - -x = <html> - <body> - <table cellpadding="2" cellspacing="0"> - <tr> - <th>Last Name</th> - <th>First Name</th> - </tr> - <tr> - <td> Tom </td> - <td> 20 </td> - </tr><tr> - <td> Bob </td> - <td> 22 </td> - </tr><tr> - <td> James </td> - <td> 19 </td> - </tr> - </table> - </body> - </html> -y = <html> - <body> - <table cellpadding="2" cellspacing="0"> - <tr> - <th>Last Name</th> - <th>First Name</th> - </tr> - <tr> - <td> Tom </td> - <td> 20 </td> - </tr><tr> - <td> Bob </td> - <td> 22 </td> - </tr><tr> - <td> James </td> - <td> 19 </td> - </tr> - </table> - </body> - </html> -x equals y: true - y equals x: true - -x = Tim -y = Tim -x equals y: true - y equals x: true - -x = Bob -y = Bob -x equals y: true - y equals x: true - -x = John -y = John -x equals y: true - y equals x: true - -x = Bill -y = Bill -x equals y: true - y equals x: true - -x = Paul -y = Paul -x equals y: true - y equals x: true - -x = <function> -y = <function> -x equals y: false - y equals x: false - diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization.scala deleted file mode 100755 index 516fa16de2..0000000000 --- a/test/files/jvm/serialization.scala +++ /dev/null @@ -1,421 +0,0 @@ -//############################################################################ -// Serialization -//############################################################################ -// $Id: serialization.scala 15934 2008-08-26 12:10:05Z michelou $ - -import java.lang.System - -object EqualityTest { - def check[A, B](x: A, y: B) { - println("x = " + x) - println("y = " + y) - println("x equals y: " + (x equals y) + " - y equals x: " + (y equals x)) - println() - } -} - -object Serialize { - @throws(classOf[java.io.IOException]) - def write[A](o: A): Array[Byte] = { - val ba = new java.io.ByteArrayOutputStream(512) - val out = new java.io.ObjectOutputStream(ba) - out.writeObject(o) - out.close() - ba.toByteArray() - } - @throws(classOf[java.io.IOException]) - @throws(classOf[ClassNotFoundException]) - def read[A](buffer: Array[Byte]): A = { - val in = - new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(buffer)) - in.readObject().asInstanceOf[A] - } -} - -//############################################################################ -// Test classes in package "scala" - -object Test1_scala { - - private def arrayToString[A](arr: Array[A]): String = - List.fromArray(arr).mkString("Array[",",","]") - - private def arrayEquals[A, B](a1: Array[A], a2: Array[B]): Boolean = - (a1.length == a2.length) && - (Iterator.range(0, a1.length) forall { i => a1(i) == a2(i) }) - - @serializable - object WeekDay extends Enumeration { - type WeekDay = Value - val Monday, Tuesday, Wednesday, Thusday, Friday, Saturday, Sunday = Value - } - import WeekDay._, BigDecimal._, RoundingMode._ - - val x0 = List(1, 2, 3) - val x1 = Nil - val x2 = None - val x3 = Array(1, 2, 3) - val x4 = { x: Int => 2 * x } - val x5 = 'hello - val x6 = ("BannerLimit", 12345) - val x7 = BigDecimal.RoundingMode - val x8 = WeekDay - val x9 = ROUND_UP - val x10 = Monday - - try { - val y0: List[Int] = Serialize.read(Serialize.write(x0)) - val y1: List[Nothing] = Serialize.read(Serialize.write(x1)) - val y2: Option[Nothing] = Serialize.read(Serialize.write(x2)) - val y3: Array[Int] = Serialize.read(Serialize.write(x3)) - val y4: Function[Int, Int] = Serialize.read(Serialize.write(x4)) - val y5: Symbol = Serialize.read(Serialize.write(x5)) - val y6: (String, Int) = Serialize.read(Serialize.write(x6)) - val y7: RoundingMode.type = Serialize.read(Serialize.write(x7)) - val y8: WeekDay.type = Serialize.read(Serialize.write(x8)) - val y9: RoundingMode = Serialize.read(Serialize.write(x9)) - val y10: WeekDay = Serialize.read(Serialize.write(x10)) - - println("x0 = " + x0) - println("y0 = " + y0) - println("x0 eq y0: " + (x0 eq y0) + " - y0 eq x0: " + (y0 eq x0)) - println("x0 equals y0: " + (x0 equals y0) + " - y0 equals x0: " + (y0 equals x0)) - println() - println("x1 = " + x1) - println("y1 = " + y1) - println("x1 eq y1: " + (x1 eq y1) + " - y1 eq x1: " + (y1 eq x1)) - println() - println("x2 = " + x2) - println("y2 = " + y2) - println("x2 eq y2: " + (x2 eq y2) + " - y2 eq x2: " + (y2 eq x2)) - println() - println("x3 = " + arrayToString(x3)) - println("y3 = " + arrayToString(y3)) - println("arrayEquals(x3, y3): " + arrayEquals(x3, y3)) - println() - println("x4 = <na>") - println("y4 = <na>") - println("x4(2): " + x4(2) + " - y4(2): " + y4(2)) - println() - println("x5 = " + x5) - println("y5 = " + y5) - println("x5 eq y5: " + (x5 eq y5) + " - y5 eq x5: " + (y5 eq x5)) - println("x5 equals y5: " + (x5 equals y5) + " - y5 equals x5: " + (y5 equals x5)) - println() - println("x6 = " + x6) - println("y6 = " + y6) - println("x6 eq y6: " + (x6 eq y6) + " - y6 eq x6: " + (y6 eq x6)) - println("x6 equals y6: " + (x6 equals y6) + " - y6 equals x6: " + (y6 equals x6)) - println() - println("x7 = " + x7) - println("y7 = " + y7) - println("x7 eq y7: " + (x7 eq y7) + " - y7 eq x7: " + (y7 eq x7)) - println("x7 equals y7: " + (x7 equals y7) + " - y7 equals x7: " + (y7 equals x7)) - println() - println("x8 = " + x8) - println("y8 = " + y8) - println("x8 eq y8: " + (x8 eq y8) + " - y8 eq x8: " + (y8 eq x8)) - println("x8 equals y8: " + (x8 equals y8) + " - y8 equals x8: " + (y8 equals x8)) - println() - println("x9 = " + x9) - println("y9 = " + y9) - println("x9 eq y9: " + (x9 eq y9) + " - y9 eq x9: " + (y9 eq x9)) - println("x9 equals y9: " + (x9 equals y9) + " - y9 equals x9: " + (y9 equals x9)) - println() - println("x10 = " + x10) - println("y10 = " + y10) - println("x10 eq y10: " + (x10 eq y10) + " - y10 eq x10: " + (y10 eq x10)) - println("x10 equals y10: " + (x10 equals y10) + " - y10 equals x10: " + (y10 equals x10)) - println() - println("x9 eq x10: " + (x9 eq x10) + " - x10 eq x9: " + (x10 eq x9)) - println("x9 equals x10: " + (x9 equals x10) + " - x10 equals x9: " + (x10 equals x9)) - println("x9 eq y10: " + (x9 eq y10) + " - y10 eq x9: " + (y10 eq x9)) - println("x9 equals y10: " + (x9 equals y10) + " - y10 equals x9: " + (y10 equals x9)) - println() - } - catch { - case e: Exception => - e.printStackTrace() - println("Error in Test1_scala: " + e) - } -} - -//############################################################################ -// Test classes in package "scala.collection.immutable" - -@serializable -object Test2_immutable { - import scala.collection.immutable.{ - BitSet, ListMap, ListSet, Queue, Stack, TreeSet, TreeMap} - - val x1 = List( - Pair("buffers", 20), - Pair("layers", 2), - Pair("title", 3) - ) - - val x2 = new ListMap[String, Int] + ("buffers" -> 20, "layers" -> 2, "title" -> 3) - - val x3 = { - val bs = new collection.mutable.BitSet() - bs += 2; bs += 3 - bs.toImmutable - } - - val x4 = new ListSet[Int]() + 3 + 5 - - val x5 = new Queue("a", "b", "c") - - val x6 = new Stack().push("a", "b", "c") - - val x7 = new TreeMap[Int, String] + (42 -> "FortyTwo") - - val x8 = new TreeSet[Int]() + 2 + 0 - - try { - val y1: List[Pair[String, Int]] = Serialize.read(Serialize.write(x1)) - val y2: ListMap[String, Int] = Serialize.read(Serialize.write(x2)) - val y3: BitSet = Serialize.read(Serialize.write(x3)) - val y4: ListSet[Int] = Serialize.read(Serialize.write(x4)) - val y5: Queue[String] = Serialize.read(Serialize.write(x5)) - val y6: Stack[String] = Serialize.read(Serialize.write(x6)) - val y7: TreeMap[Int, String] = Serialize.read(Serialize.write(x7)) - val y8: TreeSet[Int] = Serialize.read(Serialize.write(x8)) - - EqualityTest.check(x1, y1) - EqualityTest.check(x2, y2) - EqualityTest.check(x3, y3) - EqualityTest.check(x4, y4) - EqualityTest.check(x5, y5) - EqualityTest.check(x6, y6) - EqualityTest.check(x7, y7) - EqualityTest.check(x8, y8) - } - catch { - case e: Exception => - println("Error in Test2_immutable: " + e) - throw e - } -} - -//############################################################################ -// Test classes in package "scala.collection.mutable" - -object Test3_mutable { - import scala.collection.mutable.{ - ArrayBuffer, BitSet, HashMap, HashSet, History, LinkedList, ListBuffer, - Publisher, Queue, RevertableHistory, Stack} - - val x0 = new ArrayBuffer[String] - x0 ++= List("one", "two") - - val x2 = new BitSet() - x2 += 0 - x2 += 8 - x2 += 9 - - val x1 = new HashMap[String, Int] - x1 ++= Test2_immutable.x1 - - val x3 = new HashSet[String] - x3 ++= Test2_immutable.x1.map(p => p._1) - - @serializable - class Feed extends Publisher[String, Feed] - - val x8 = new History[String, Feed] - - val x4 = new LinkedList[Int](2, null) - x4.append(new LinkedList(3, null)) - - val x7 = new ListBuffer[String] - x7 ++= List("white", "black") - - val x5 = new Queue[Int] - x5 ++= Test2_immutable.x1.map(p => p._2) - - val x6 = new Stack[Int] - x6 ++= x5 - - try { - val y0: ArrayBuffer[String] = Serialize.read(Serialize.write(x0)) - val y1: HashMap[String, Int] = Serialize.read(Serialize.write(x1)) - val y2: BitSet = Serialize.read(Serialize.write(x2)) - val y3: HashSet[String] = Serialize.read(Serialize.write(x3)) - val y4: LinkedList[Int] = Serialize.read(Serialize.write(x4)) - val y5: Queue[Int] = Serialize.read(Serialize.write(x5)) - val y6: Stack[Int] = Serialize.read(Serialize.write(x6)) - val y7: ListBuffer[String] = Serialize.read(Serialize.write(x7)) - val y8: History[String, Feed] = Serialize.read(Serialize.write(x8)) - - EqualityTest.check(x0, y0) - EqualityTest.check(x1, y1) - EqualityTest.check(x2, y2) - EqualityTest.check(x3, y3) - EqualityTest.check(x4, y4) - EqualityTest.check(x5, y5) - EqualityTest.check(x6, y6) - EqualityTest.check(x7, y7) - //EqualityTest.check(x8, y8) //todo - } - catch { - case e: Exception => - println("Error in Test3_mutable: " + e) - } -} - -//############################################################################ -// Test classes in package "scala.xml" - -object Test4_xml { - import scala.xml.Elem - - val x1 = <html><title>title</title><body></body></html>; - - case class Person(name: String, age: Int) - - class AddressBook(a: Person*) { - private val people: List[Person] = a.toList - def toXHTML = - <table cellpadding="2" cellspacing="0"> - <tr> - <th>Last Name</th> - <th>First Name</th> - </tr> - { for (val p <- people) yield - <tr> - <td> { p.name } </td> - <td> { p.age.toString() } </td> - </tr> } - </table>; - } - - val people = new AddressBook( - Person("Tom", 20), - Person("Bob", 22), - Person("James", 19)) - - val x2 = - <html> - <body> - { people.toXHTML } - </body> - </html>; - - try { - val y1: scala.xml.Elem = Serialize.read(Serialize.write(x1)) - val y2: scala.xml.Elem = Serialize.read(Serialize.write(x2)) - - EqualityTest.check(x1, y1) - EqualityTest.check(x2, y2) - } - catch { - case e: Exception => - println("Error in Test4_xml: " + e) - } -} - -//############################################################################ -// Test user-defined classes WITHOUT nesting - -@serializable -class Person(_name: String) { - private var name = _name - override def toString() = name - override def equals(that: Any): Boolean = - that.isInstanceOf[Person] && - (name == that.asInstanceOf[Person].name) -} - -@serializable -class Employee(_name: String) { - private var name = _name - override def toString() = name -} -@serializable -object bob extends Employee("Bob") - -object Test5 { - val x1 = new Person("Tim") - val x2 = bob - - try { - val y1: Person = Serialize.read(Serialize.write(x1)) - val y2: Employee = Serialize.read(Serialize.write(x2)) - - EqualityTest.check(x1, y1) - EqualityTest.check(x2, y2) - } - catch { - case e: Exception => - println("Error in Test5: " + e) - } -} - -//############################################################################ -// Test user-defined classes WITH nesting - -@serializable -object Test6 { - @serializable - object bill extends Employee("Bill") { - val x = paul - } - @serializable - object paul extends Person("Paul") { - val x = 4 // bill; => StackOverflowException !!! - } - val x1 = new Person("John") - val x2 = bill - val x3 = paul - - try { - val y1: Person = Serialize.read(Serialize.write(x1)) - val y2: Employee = Serialize.read(Serialize.write(x2)) - val y3: Person = Serialize.read(Serialize.write(x3)) - - EqualityTest.check(x1, y1) - EqualityTest.check(x2, y2) - EqualityTest.check(x3, y3) - } - catch { - case e: Exception => - println("Error in Test6: " + e) - } -} - -object Test7 { - @serializable - class A(a: Int) { -// def this() { this(0) } - val f = (x: Int) => x + a - } - try { - val a = new A(1) - val f1: Int => Int = Serialize.read(Serialize.write(a.f)) - - EqualityTest.check(a.f, f1) - } - catch { - case e: Exception => - println("Error in Test7: " + e) - } -} - -//############################################################################ -// Test code - -object Test { - def main(args: Array[String]) { - Test1_scala - Test2_immutable - Test3_mutable - Test4_xml - Test5 - Test6 - Test7 - } -} - -//############################################################################ - diff --git a/test/files/jvm/t1652.check b/test/files/jvm/t1652.check new file mode 100755 index 0000000000..dfa480ce6e --- /dev/null +++ b/test/files/jvm/t1652.check @@ -0,0 +1,2 @@ +OK1 +OK2 diff --git a/test/files/jvm/xml01.check b/test/files/jvm/xml01.check deleted file mode 100644 index d78e6df410..0000000000 --- a/test/files/jvm/xml01.check +++ /dev/null @@ -1,8 +0,0 @@ -equality -xpath \ -xpath \\ DESCENDANTS -<book><author>Peter Buneman</author><author>Dan Suciu</author><title>Data on ze web</title></book> --- group nodes -<f><a/><b/><c/></f> -<a/><f><a/><b/><c/></f><a/><b/><c/> -attribute value normalization diff --git a/test/files/jvm/xml01.scala b/test/files/jvm/xml01.scala deleted file mode 100644 index 56d9646fa3..0000000000 --- a/test/files/jvm/xml01.scala +++ /dev/null @@ -1,231 +0,0 @@ -import java.io.StringReader -import org.xml.sax.InputSource - -import scala.testing.SUnit._ -import scala.util.logging._ -import scala.xml._ - - -object Test extends Application with Assert { - val e: scala.xml.MetaData = Null //Node.NoAttributes - val sc: scala.xml.NamespaceBinding = TopScope - - val xmlFile1 = "<hello><world/></hello>"; - val isrc1 = new InputSource(new StringReader(xmlFile1)) - val parsedxml1 = XML.load(isrc1) - val isrc11 = new InputSource(new StringReader(xmlFile1)) - val parsedxml11 = XML.load(isrc11) - - val c = new Node { - def label = "hello" - override def hashCode() = - Utility.hashCode(prefix, label, attributes.hashCode(), scope.hashCode(), child); - def child = Elem(null, "world", e, sc); - //def attributes = e; - override def text = "" - } - - assertSameElements(List(3), List(3)) - - println("equality") - assertEquals(c, parsedxml11) - assertEquals(parsedxml1, parsedxml11) - assertSameElements(List(parsedxml1), List(parsedxml11)) - assertSameElements(Array(parsedxml1).toList, List(parsedxml11)) - - val x2 = "<book><author>Peter Buneman</author><author>Dan Suciu</author><title>Data on ze web</title></book>"; - - val i = new InputSource(new StringReader(x2)) - val x2p = XML.load(i) - - assertEquals(x2p, Elem(null, "book" , e, sc, - Elem(null, "author", e, sc,Text("Peter Buneman")), - Elem(null, "author", e, sc,Text("Dan Suciu")), - Elem(null, "title" , e, sc,Text("Data on ze web")))); - - val xmlFile2 = "<bib><book><author>Peter Buneman</author><author>Dan Suciu</author><title>Data on ze web</title></book><book><author>John Mitchell</author><title>Foundations of Programming Languages</title></book></bib>"; - val isrc2 = new InputSource(new StringReader(xmlFile2)) - val parsedxml2 = XML.load(isrc2) - - // xmlFile2/book -> book,book - println("xpath \\") - - - assertSameElements(parsedxml1 \ "_" , List(Elem(null,"world", e, sc))) - - assertSameElements(parsedxml1 \ "world", List(Elem(null,"world", e, sc))) - -/* - Console.println( parsedxml2 \ "_" ); - Console.println( (parsedxml2 \ "_" ).elements); - for( val i <- (parsedxml2 \ "_" ).elements) { - Console.println( i ); - }; - */ - - assertSameElements( - parsedxml2 \ "_" , - - List( - Elem(null,"book", e, sc, - Elem(null,"author", e, sc, Text("Peter Buneman")), - Elem(null,"author", e, sc, Text("Dan Suciu")), - Elem(null,"title" , e, sc, Text("Data on ze web"))), - Elem(null,"book",e,sc, - Elem(null,"author",e,sc,Text("John Mitchell")), - Elem(null,"title",e,sc,Text("Foundations of Programming Languages")))) - ); - assertEquals( (parsedxml2 \ "author").length, 0 ); - - assertSameElements( - parsedxml2 \ "book", - - List( - Elem(null,"book",e,sc, - Elem(null,"author", e, sc, Text("Peter Buneman")), - Elem(null,"author", e, sc, Text("Dan Suciu")), - Elem(null,"title" , e, sc, Text("Data on ze web"))), - Elem(null,"book",e,sc, - Elem(null,"author", e, sc, Text("John Mitchell")), - Elem(null,"title" , e, sc, Text("Foundations of Programming Languages"))) - ) - ); - - assertSameElements( - - parsedxml2 \ "_" \ "_", - - List( - Elem(null,"author", e, sc, Text("Peter Buneman")), - Elem(null,"author", e, sc, Text("Dan Suciu")), - Elem(null,"title" , e, sc, Text("Data on ze web")), - Elem(null,"author", e, sc, Text("John Mitchell")), - Elem(null,"title" , e, sc, Text("Foundations of Programming Languages")) - ) - ); - - assertSameElements( - - parsedxml2 \ "_" \ "author", - - List( - Elem(null,"author", e, sc, Text("Peter Buneman")), - Elem(null,"author", e, sc, Text("Dan Suciu")), - Elem(null,"author", e, sc, Text("John Mitchell")) - ) - - ); - - assertSameElements( (parsedxml2 \ "_" \ "_" \ "author"), List() ); - - Console.println("xpath \\\\ DESCENDANTS"); - - assertSameElements( - - parsedxml2 \\ "author", - - List( - Elem(null,"author", e, sc, Text("Peter Buneman")), - Elem(null,"author", e, sc, Text("Dan Suciu")), - Elem(null,"author", e, sc, Text("John Mitchell")) - ) - - ); - - - assertSameElements( - - parsedxml2 \\ "title", - - List( - Elem(null,"title", e, sc, Text("Data on ze web")), - Elem(null,"title", e, sc, Text("Foundations of Programming Languages"))) - ); - - - println( - (parsedxml2 \\ "book" ){ n:Node => n \ "title" == "Data on ze web" } - ); - - assertEquals( - - (new NodeSeq { val theSeq = List( parsedxml2 ) }) \\ "_", - - List( - Elem(null,"bib",e,sc, - Elem(null,"book",e,sc, - Elem(null, "author", e, sc, Text("Peter Buneman")), - Elem(null, "author", e, sc, Text("Dan Suciu")), - Elem(null, "title" , e, sc, Text("Data on ze web"))), - Elem(null,"book",e,sc, - Elem(null,"author",e,sc,Text("John Mitchell")), - Elem(null,"title",e,sc,Text("Foundations of Programming Languages")))), - Elem(null,"book",e,sc, - Elem(null,"author",e,sc,Text("Peter Buneman")), - Elem(null,"author",e,sc,Text("Dan Suciu")), - Elem(null,"title",e,sc,Text("Data on ze web"))), - Elem(null,"author",e,sc,Text("Peter Buneman")), - //Text("Peter Buneman"), - Elem(null,"author",e,sc,Text("Dan Suciu")), - //Text("Dan Suciu"), - Elem(null,"title",e,sc,Text("Data on ze web")), - //Text("Data on ze web"), - Elem(null,"book",e,sc, - Elem(null,"author",e,sc,Text("John Mitchell")), - Elem(null,"title",e,sc,Text("Foundations of Programming Languages"))), - Elem(null,"author",e,sc,Text("John Mitchell")), - //Text("John Mitchell"), - Elem(null,"title",e,sc,Text("Foundations of Programming Languages")) - //Text("Foundations of Programming Languages") - ) - ); - - // test group node - Console println "-- group nodes" - val zx1: Node = Group { <a/><b/><c/> } - val zy1 = <f>{zx1}</f> - Console println zy1.toString() - - val zx2: Node = Group { List(<a/>,zy1,zx1) } - Console println zx2.toString() - - val zz1 = <xml:group><a/><b/><c/></xml:group> - - assertTrue(zx1 == zz1) - assertTrue(zz1.length == 3) - - // unparsed - - val uup = <xml:unparsed>&<<>""^%@$!#</xml:unparsed> - assertTrue(uup == "&<<>\"\"^%@$!#") - // test unicode escapes backslash u - - println("attribute value normalization") - val xmlAttrValueNorm = "<personne id='p0003' nom='Şahingöz' />"; - { - val isrcA = new InputSource( new StringReader(xmlAttrValueNorm) ); - val parsedxmlA = XML.load(isrcA); - val c = (parsedxmlA \ "@nom").text.charAt(0); - //Console.println("char '"+c+"' \u015e"); - assertTrue(c == '\u015e'); - } - // buraq: if the following test fails with 'character x not allowed', it is - // related to the mutable variable in a closures in MarkupParser.parsecharref - { - val isr = scala.io.Source.fromString(xmlAttrValueNorm); - val pxmlB = scala.xml.parsing.ConstructingParser.fromSource(isr,false); - val parsedxmlB = pxmlB.element(TopScope); - val c = (parsedxmlB \ "@nom").text.charAt(0); - //Console.println("char '"+c+"' \u015e"); - assertTrue(c == '\u015e'); - } - - // #60 test by round trip - - val p = scala.xml.parsing.ConstructingParser.fromSource(scala.io.Source.fromString("<foo bar:attr='&'/>"),true) - val n = p.element(new scala.xml.NamespaceBinding("bar","BAR",scala.xml.TopScope))(0) - assertFalse( n.attributes.get("BAR", n, "attr").isEmpty) - - // #547 test - assertTrue(<xml:group>hello</xml:group>.toString == "hello") -} diff --git a/test/files/jvm/xml02.scala b/test/files/jvm/xml02.scala index 52ce3a0060..ed29868898 100644 --- a/test/files/jvm/xml02.scala +++ b/test/files/jvm/xml02.scala @@ -3,7 +3,7 @@ import testing.SUnit._ object Test extends TestConsoleMain { import scala.xml.{NodeSeq, Utility} - import NodeSeq.view + import NodeSeq.seqToNodeSeq val ax = <hello foo="bar" x:foo="baz" xmlns:x="the namespace from outer space"> <world/> diff --git a/test/files/jvm5/stringbuilder.scala b/test/files/jvm5/stringbuilder.scala index c369d717d5..cbbfa022b0 100644 --- a/test/files/jvm5/stringbuilder.scala +++ b/test/files/jvm5/stringbuilder.scala @@ -49,6 +49,7 @@ object Test2 extends TestCase("append") with Assert { j0 append true append (1.toByte) append 'a' append 9 append -1L append 1.2e-10f append -2.1e+100d s0 append true append (1.toByte) append 'a' append 9 append -1L append 1.2e-10f append -2.1e+100d + assertEquals("s0.toString equals j0.toString", true, s0.toString equals j0.toString) val j1 = new java.lang.StringBuilder // Java 1.5+ diff --git a/test/files/neg/badtok-1.check b/test/files/neg/badtok-1.check index 94116d321c..318ba1fcbc 100644 --- a/test/files/neg/badtok-1.check +++ b/test/files/neg/badtok-1.check @@ -1,7 +1,7 @@ -badtok-1.scala:2: error: missing terminating quote +badtok-1.scala:2: error: expected class or object definition '42' ^ -badtok-1.scala:2: error: unterminated character literal +badtok-1.scala:2: error: unclosed character literal '42' ^ two errors found diff --git a/test/files/neg/badtok-2.check b/test/files/neg/badtok-2.check index 6364b857a1..5fb3bf660c 100644 --- a/test/files/neg/badtok-2.check +++ b/test/files/neg/badtok-2.check @@ -1,4 +1,4 @@ -badtok-2.scala:3: error: unterminated quoted identifier +badtok-2.scala:3: error: unclosed quoted identifier `x ^ badtok-2.scala:3: error: '}' expected but eof found. diff --git a/test/files/neg/bug550.check b/test/files/neg/bug550.check index 252580a327..10b2a38586 100644 --- a/test/files/neg/bug550.check +++ b/test/files/neg/bug550.check @@ -1,4 +1,4 @@ -bug550.scala:6: error: class List takes type parameters +bug550.scala:6: error: type List takes type parameters def sum[a](xs: List)(implicit m: Monoid[a]): a = ^ bug550.scala:8: error: no implicit argument matching parameter type Monoid[a] was found. diff --git a/test/files/neg/bug585.check b/test/files/neg/bug585.check index af66898383..4f4c5bf31d 100644 --- a/test/files/neg/bug585.check +++ b/test/files/neg/bug585.check @@ -1,4 +1,4 @@ -bug585.scala:1: error: unterminated comment +bug585.scala:1: error: unclosed comment /* ^ one error found diff --git a/test/files/neg/bug668.check b/test/files/neg/bug668.check index 698cef67e9..10be0c8d14 100644 --- a/test/files/neg/bug668.check +++ b/test/files/neg/bug668.check @@ -1,4 +1,4 @@ -bug668.scala:1: error: trait Iterable takes type parameters +bug668.scala:1: error: type Iterable takes type parameters class Test extends Iterable ^ one error found diff --git a/test/files/neg/bug876.check b/test/files/neg/bug876.check index 8ef2c031fc..a9aecbaadc 100644 --- a/test/files/neg/bug876.check +++ b/test/files/neg/bug876.check @@ -1,4 +1,4 @@ -bug876.scala:25: error: wrong number of arguments for method apply: (AssertionError.A)manager.B in trait Map +bug876.scala:25: error: wrong number of arguments for method apply: (AssertionError.A)manager.B in trait MapTemplate assert(manager.map(A2) == List(manager.map(A2, A1))) ^ one error found diff --git a/test/files/neg/bug910.check b/test/files/neg/bug910.check index ffb07faf2a..4ec73094cd 100644 --- a/test/files/neg/bug910.check +++ b/test/files/neg/bug910.check @@ -1,5 +1,5 @@ bug910.scala:4: error: type mismatch; - found : Seq[Char] + found : Sequence[Char] required: Seq[int] val y: Seq[int] = rest ^ diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check index 21d0d819ea..df1266066e 100644 --- a/test/files/neg/checksensible.check +++ b/test/files/neg/checksensible.check @@ -23,8 +23,8 @@ checksensible.scala:11: warning: comparing a fresh object using `==' will always println(new Object == new Object) ^ checksensible.scala:12: warning: comparing a fresh object using `!=' will always yield true - println(new Array(1) != new Array(1)) - ^ + println(new Exception() != new Exception()) + ^ checksensible.scala:15: warning: comparing values of types Int and Null using `==' will always yield false if (foo.length == null) // == 0 makes more sense, but still ^ diff --git a/test/files/neg/checksensible.scala b/test/files/neg/checksensible.scala index 1fed2e4b57..f895d09d0b 100644 --- a/test/files/neg/checksensible.scala +++ b/test/files/neg/checksensible.scala @@ -9,7 +9,7 @@ class Test { println(((x: Int) => x + 1) == null) println(new Object == new Object) - println(new Array(1) != new Array(1)) + println(new Exception() != new Exception()) val foo: Array[String] = Array("1","2","3") if (foo.length == null) // == 0 makes more sense, but still diff --git a/test/files/neg/plugin-after-terminal.check b/test/files/neg/plugin-after-terminal.check deleted file mode 100644 index b846dc0ab5..0000000000 --- a/test/files/neg/plugin-after-terminal.check +++ /dev/null @@ -1,2 +0,0 @@ -error: [phase assembly, after dependency on terminal phase not allowed: afterterminal => terminal] -one error found
\ No newline at end of file diff --git a/test/files/neg/plugin-after-terminal.flags b/test/files/neg/plugin-after-terminal.flags deleted file mode 100644 index 6a44376213..0000000000 --- a/test/files/neg/plugin-after-terminal.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-after-terminal/lib/plugins.jar - diff --git a/test/files/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1 deleted file mode 100644 index 835b5b8a05..0000000000 --- a/test/files/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -b27d9a4cc768179da1d43f77dff631f900f050d0 ?plugins.jar diff --git a/test/files/neg/plugin-after-terminal/misc/build.sh b/test/files/neg/plugin-after-terminal/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/files/neg/plugin-after-terminal/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/files/neg/plugin-after-terminal/misc/scalac-plugin.xml b/test/files/neg/plugin-after-terminal/misc/scalac-plugin.xml deleted file mode 100644 index 58fff40950..0000000000 --- a/test/files/neg/plugin-after-terminal/misc/scalac-plugin.xml +++ /dev/null @@ -1,6 +0,0 @@ -<!-- $Id$ --> -<plugin> - <name>beforeparser</name> - <classname>scala.test.plugins.ThePlugin</classname> -</plugin> - diff --git a/test/files/neg/plugin-after-terminal/src/ThePlugin.scala b/test/files/neg/plugin-after-terminal/src/ThePlugin.scala deleted file mode 100644 index f3c913086e..0000000000 --- a/test/files/neg/plugin-after-terminal/src/ThePlugin.scala +++ /dev/null @@ -1,31 +0,0 @@ -package scala.test.plugins - -import scala.tools.nsc -import nsc.Global -import nsc.Phase -import nsc.plugins.Plugin -import nsc.plugins.PluginComponent - -class ThePlugin(val global: Global) extends Plugin { - import global._ - - val name = "afterterminal" - val description = "Declares one plugin that wants to be after the terminal phase" - val components = List[PluginComponent](thePhase) - - private object thePhase extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]("terminal") - - val phaseName = ThePlugin.this.name - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/files/neg/plugin-after-terminal/testsource.scala b/test/files/neg/plugin-after-terminal/testsource.scala deleted file mode 100644 index 519d162fdf..0000000000 --- a/test/files/neg/plugin-after-terminal/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("afterterminal") -} - diff --git a/test/files/neg/plugin-before-parser.check b/test/files/neg/plugin-before-parser.check deleted file mode 100644 index 253659eedb..0000000000 --- a/test/files/neg/plugin-before-parser.check +++ /dev/null @@ -1,2 +0,0 @@ -error: [phase assembly, before dependency on parser phase not allowed: parser => beforeparser] -one error found
\ No newline at end of file diff --git a/test/files/neg/plugin-before-parser.flags b/test/files/neg/plugin-before-parser.flags deleted file mode 100644 index 632530922c..0000000000 --- a/test/files/neg/plugin-before-parser.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-before-parser/lib/plugins.jar - diff --git a/test/files/neg/plugin-before-parser/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-before-parser/lib/plugins.jar.desired.sha1 deleted file mode 100644 index b9320adb9c..0000000000 --- a/test/files/neg/plugin-before-parser/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -9cca2242701f71f4369067e0fed8c7da2fd72f62 ?plugins.jar diff --git a/test/files/neg/plugin-before-parser/misc/build.sh b/test/files/neg/plugin-before-parser/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/files/neg/plugin-before-parser/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/files/neg/plugin-before-parser/misc/scalac-plugin.xml b/test/files/neg/plugin-before-parser/misc/scalac-plugin.xml deleted file mode 100644 index 58fff40950..0000000000 --- a/test/files/neg/plugin-before-parser/misc/scalac-plugin.xml +++ /dev/null @@ -1,6 +0,0 @@ -<!-- $Id$ --> -<plugin> - <name>beforeparser</name> - <classname>scala.test.plugins.ThePlugin</classname> -</plugin> - diff --git a/test/files/neg/plugin-before-parser/src/ThePlugin.scala b/test/files/neg/plugin-before-parser/src/ThePlugin.scala deleted file mode 100644 index 8714a55dc4..0000000000 --- a/test/files/neg/plugin-before-parser/src/ThePlugin.scala +++ /dev/null @@ -1,32 +0,0 @@ -package scala.test.plugins - -import scala.tools.nsc -import nsc.Global -import nsc.Phase -import nsc.plugins.Plugin -import nsc.plugins.PluginComponent - -class ThePlugin(val global: Global) extends Plugin { - import global._ - - val name = "beforeparser" - val description = "Declares one plugin that wants to be before the parser phase" - val components = List[PluginComponent](thePhase) - - private object thePhase extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]() - override val runsBefore = List[String]("parser") - - val phaseName = ThePlugin.this.name - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/files/neg/plugin-before-parser/testsource.scala b/test/files/neg/plugin-before-parser/testsource.scala deleted file mode 100644 index 9928aaa83c..0000000000 --- a/test/files/neg/plugin-before-parser/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("beforeparser") -} - diff --git a/test/files/neg/plugin-cyclic-dependency.check b/test/files/neg/plugin-cyclic-dependency.check deleted file mode 100644 index 7c1aeebfa0..0000000000 --- a/test/files/neg/plugin-cyclic-dependency.check +++ /dev/null @@ -1,2 +0,0 @@ -error: fatal error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice! -one error found
\ No newline at end of file diff --git a/test/files/neg/plugin-cyclic-dependency.flags b/test/files/neg/plugin-cyclic-dependency.flags deleted file mode 100644 index 8716aaa65f..0000000000 --- a/test/files/neg/plugin-cyclic-dependency.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-cyclic-dependency/lib/plugins.jar - diff --git a/test/files/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1 deleted file mode 100644 index 7d62792253..0000000000 --- a/test/files/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -adfc1223549e592354b56821ee9ed808d391a859 ?plugins.jar diff --git a/test/files/neg/plugin-cyclic-dependency/misc/build.sh b/test/files/neg/plugin-cyclic-dependency/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/files/neg/plugin-cyclic-dependency/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/files/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml b/test/files/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml deleted file mode 100644 index 58fff40950..0000000000 --- a/test/files/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml +++ /dev/null @@ -1,6 +0,0 @@ -<!-- $Id$ --> -<plugin> - <name>beforeparser</name> - <classname>scala.test.plugins.ThePlugin</classname> -</plugin> - diff --git a/test/files/neg/plugin-cyclic-dependency/src/ThePlugin.scala b/test/files/neg/plugin-cyclic-dependency/src/ThePlugin.scala deleted file mode 100644 index 1dfc15cb28..0000000000 --- a/test/files/neg/plugin-cyclic-dependency/src/ThePlugin.scala +++ /dev/null @@ -1,41 +0,0 @@ -package scala.test.plugins - -import scala.tools.nsc -import nsc.Global -import nsc.Phase -import nsc.plugins.Plugin -import nsc.plugins.PluginComponent - -class ThePlugin(val global: Global) extends Plugin { - import global._ - - val name = "cyclicdependency" - val description = "Declares two phases that have a cyclic dependency" - val components = List[PluginComponent](thePhase1,thePhase2) - - private object thePhase1 extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]("tailcalls","cyclicdependency2") - - val phaseName = ThePlugin.this.name + "1" - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private object thePhase2 extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]("dce","cyclicdependency1") - - val phaseName = ThePlugin.this.name + "2" - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/files/neg/plugin-cyclic-dependency/testsource.scala b/test/files/neg/plugin-cyclic-dependency/testsource.scala deleted file mode 100644 index f1513ec9a0..0000000000 --- a/test/files/neg/plugin-cyclic-dependency/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("cyclicdependency") -} - diff --git a/test/files/neg/plugin-multiple-rafter.check b/test/files/neg/plugin-multiple-rafter.check deleted file mode 100644 index 5ba932413f..0000000000 --- a/test/files/neg/plugin-multiple-rafter.check +++ /dev/null @@ -1,4 +0,0 @@ -error: fatal error: Multiple phases want to run right after the phase explicitouter -Phases: erasure, multi-rafter, -Re-run with -Xgenerate-phase-graph <filename> to better see the problem. -one error found
\ No newline at end of file diff --git a/test/files/neg/plugin-multiple-rafter.flags b/test/files/neg/plugin-multiple-rafter.flags deleted file mode 100644 index dcae7f2f96..0000000000 --- a/test/files/neg/plugin-multiple-rafter.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-multiple-rafter/lib/plugins.jar - diff --git a/test/files/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1 deleted file mode 100644 index 243acf76d7..0000000000 --- a/test/files/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -3f1b1571728dc322666ad8a78cdbb943eee0c013 ?plugins.jar diff --git a/test/files/neg/plugin-multiple-rafter/misc/build.sh b/test/files/neg/plugin-multiple-rafter/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/files/neg/plugin-multiple-rafter/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/files/neg/plugin-multiple-rafter/misc/scalac-plugin.xml b/test/files/neg/plugin-multiple-rafter/misc/scalac-plugin.xml deleted file mode 100644 index 58fff40950..0000000000 --- a/test/files/neg/plugin-multiple-rafter/misc/scalac-plugin.xml +++ /dev/null @@ -1,6 +0,0 @@ -<!-- $Id$ --> -<plugin> - <name>beforeparser</name> - <classname>scala.test.plugins.ThePlugin</classname> -</plugin> - diff --git a/test/files/neg/plugin-multiple-rafter/src/ThePlugin.scala b/test/files/neg/plugin-multiple-rafter/src/ThePlugin.scala deleted file mode 100644 index 4c761517c1..0000000000 --- a/test/files/neg/plugin-multiple-rafter/src/ThePlugin.scala +++ /dev/null @@ -1,31 +0,0 @@ -package scala.test.plugins - -import scala.tools.nsc -import nsc.Global -import nsc.Phase -import nsc.plugins.Plugin -import nsc.plugins.PluginComponent - -class ThePlugin(val global: Global) extends Plugin { - import global._ - - val name = "multi-rafter" - val description = "" - val components = List[PluginComponent](thePhase) - - private object thePhase extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]() - override val runsRightAfter = Some("explicitouter") - val phaseName = ThePlugin.this.name - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/files/neg/plugin-multiple-rafter/testsource.scala b/test/files/neg/plugin-multiple-rafter/testsource.scala deleted file mode 100644 index f73db1eb60..0000000000 --- a/test/files/neg/plugin-multiple-rafter/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("multi-rafter") -} - diff --git a/test/files/neg/plugin-rafter-before-1.check b/test/files/neg/plugin-rafter-before-1.check deleted file mode 100644 index 7afe3be031..0000000000 --- a/test/files/neg/plugin-rafter-before-1.check +++ /dev/null @@ -1,2 +0,0 @@ -error: fatal error: phase erasure want to run right after explicitouter, but some phase has declared to run before erasure. Re-run with -Xgenerate-phase-graph <filename> to better see the problem. -one error found
\ No newline at end of file diff --git a/test/files/neg/plugin-rafter-before-1.flags b/test/files/neg/plugin-rafter-before-1.flags deleted file mode 100644 index 8bf03145b9..0000000000 --- a/test/files/neg/plugin-rafter-before-1.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-rafter-before-1/lib/plugins.jar - diff --git a/test/files/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1 deleted file mode 100644 index 1aa5a0aaf1..0000000000 --- a/test/files/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -4583290684b78581ce2e6affaa37b38d06e8dc45 ?plugins.jar diff --git a/test/files/neg/plugin-rafter-before-1/misc/build.sh b/test/files/neg/plugin-rafter-before-1/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/files/neg/plugin-rafter-before-1/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/files/neg/plugin-rafter-before-1/misc/scalac-plugin.xml b/test/files/neg/plugin-rafter-before-1/misc/scalac-plugin.xml deleted file mode 100644 index 58fff40950..0000000000 --- a/test/files/neg/plugin-rafter-before-1/misc/scalac-plugin.xml +++ /dev/null @@ -1,6 +0,0 @@ -<!-- $Id$ --> -<plugin> - <name>beforeparser</name> - <classname>scala.test.plugins.ThePlugin</classname> -</plugin> - diff --git a/test/files/neg/plugin-rafter-before-1/src/ThePlugin.scala b/test/files/neg/plugin-rafter-before-1/src/ThePlugin.scala deleted file mode 100644 index c42a914066..0000000000 --- a/test/files/neg/plugin-rafter-before-1/src/ThePlugin.scala +++ /dev/null @@ -1,31 +0,0 @@ -package scala.test.plugins - -import scala.tools.nsc -import nsc.Global -import nsc.Phase -import nsc.plugins.Plugin -import nsc.plugins.PluginComponent - -class ThePlugin(val global: Global) extends Plugin { - import global._ - - val name = "rafter-before-1" - val description = "" - val components = List[PluginComponent](thePhase1) - - private object thePhase1 extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]("refchecks") - override val runsBefore = List[String]("erasure") - val phaseName = ThePlugin.this.name - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/files/neg/plugin-rafter-before-1/testsource.scala b/test/files/neg/plugin-rafter-before-1/testsource.scala deleted file mode 100644 index 836459db22..0000000000 --- a/test/files/neg/plugin-rafter-before-1/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("rafter-before-1") -} - diff --git a/test/files/neg/plugin-rightafter-terminal.check b/test/files/neg/plugin-rightafter-terminal.check deleted file mode 100644 index 8107c373e0..0000000000 --- a/test/files/neg/plugin-rightafter-terminal.check +++ /dev/null @@ -1,2 +0,0 @@ -error: [phase assembly, right after dependency on terminal phase not allowed: rightafterterminal => terminal] -one error found
\ No newline at end of file diff --git a/test/files/neg/plugin-rightafter-terminal.flags b/test/files/neg/plugin-rightafter-terminal.flags deleted file mode 100644 index 948a318668..0000000000 --- a/test/files/neg/plugin-rightafter-terminal.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-rightafter-terminal/lib/plugins.jar - diff --git a/test/files/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1 deleted file mode 100644 index be3c84d6dd..0000000000 --- a/test/files/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -2220a89d53daa59e0daedbfd432bb5e8810e20d3 ?plugins.jar diff --git a/test/files/neg/plugin-rightafter-terminal/misc/build.sh b/test/files/neg/plugin-rightafter-terminal/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/files/neg/plugin-rightafter-terminal/misc/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/" - -BASE=`pwd` - -if [[ -d "${BASE}/src" ]] ; then - - mkdir -p build - ${SCALAC} -d build src/*.scala - jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build . - rm -rf build -fi - diff --git a/test/files/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml b/test/files/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml deleted file mode 100644 index 58fff40950..0000000000 --- a/test/files/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml +++ /dev/null @@ -1,6 +0,0 @@ -<!-- $Id$ --> -<plugin> - <name>beforeparser</name> - <classname>scala.test.plugins.ThePlugin</classname> -</plugin> - diff --git a/test/files/neg/plugin-rightafter-terminal/src/ThePlugin.scala b/test/files/neg/plugin-rightafter-terminal/src/ThePlugin.scala deleted file mode 100644 index 47dd06ec8a..0000000000 --- a/test/files/neg/plugin-rightafter-terminal/src/ThePlugin.scala +++ /dev/null @@ -1,32 +0,0 @@ -package scala.test.plugins - -import scala.tools.nsc -import nsc.Global -import nsc.Phase -import nsc.plugins.Plugin -import nsc.plugins.PluginComponent - -class ThePlugin(val global: Global) extends Plugin { - import global._ - - val name = "rightafterterminal" - val description = "Declares one plugin that wants to be right after the terminal phase" - val components = List[PluginComponent](thePhase) - - private object thePhase extends PluginComponent { - val global = ThePlugin.this.global - - val runsAfter = List[String]() - override val runsRightAfter = Some("terminal") - - val phaseName = ThePlugin.this.name - - def newPhase(prev: Phase) = new ThePhase(prev) - } - - private class ThePhase(prev: Phase) extends Phase(prev) { - def name = ThePlugin.this.name - def run {} - } -} - diff --git a/test/files/neg/plugin-rightafter-terminal/testsource.scala b/test/files/neg/plugin-rightafter-terminal/testsource.scala deleted file mode 100644 index 7af767b638..0000000000 --- a/test/files/neg/plugin-rightafter-terminal/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("rightafterterminal") -} - diff --git a/test/files/neg/t0003.check b/test/files/neg/t0003.check index 5e29b189db..fb5bb5671d 100644 --- a/test/files/neg/t0003.check +++ b/test/files/neg/t0003.check @@ -1,6 +1,6 @@ t0003.scala:2: error: type mismatch; found : (A) => (B) => B - required: (?) => B + required: (A) => B def foo[A, B, C](l: List[A], f: A => B=>B, g: B=>B=>C): List[C] = l map (g compose f) ^ one error found diff --git a/test/files/neg/t0259.check b/test/files/neg/t0259.check index 8c6ce1d269..b0ab856278 100644 --- a/test/files/neg/t0259.check +++ b/test/files/neg/t0259.check @@ -1,7 +1,7 @@ t0259.scala:4: error: double definition: constructor TestCase3:(String*)test.TestCase3 and constructor TestCase3:((String, Int)*)test.TestCase3 at line 3 -have same type after erasure: (Seq)test.TestCase3 +have same type after erasure: (Sequence)test.TestCase3 def this( groups: String*) = this() ^ one error found diff --git a/test/files/neg/t0673.check b/test/files/neg/t0673.check index abb37a022c..cc67e994f4 100644 --- a/test/files/neg/t0673.check +++ b/test/files/neg/t0673.check @@ -1,4 +1,4 @@ -Test.scala:2: error: value InnerClass is not a member of object JavaClass +Test.scala:2: error: object InnerClass is not a value val x = JavaClass.InnerClass ^ one error found diff --git a/test/files/neg/wellkinded_bounds.check b/test/files/neg/wellkinded_bounds.check index 9099934c68..806eb09a76 100644 --- a/test/files/neg/wellkinded_bounds.check +++ b/test/files/neg/wellkinded_bounds.check @@ -1,4 +1,4 @@ -wellkinded_bounds.scala:2: error: class List takes type parameters +wellkinded_bounds.scala:2: error: type List takes type parameters class WellKindedWrongSyntax[s <: List] { // must be s[x] <: List[x] ^ one error found diff --git a/test/files/neg/xmlcorner.check b/test/files/neg/xmlcorner.check index 5d3e9288d5..8791829e50 100644 --- a/test/files/neg/xmlcorner.check +++ b/test/files/neg/xmlcorner.check @@ -3,5 +3,5 @@ xmlcorner.scala:2: error: illegal start of simple expression ^ xmlcorner.scala:5: error: in XML literal: name cannot end in ':' val wrong = <bla: /> - ^ + ^ two errors found diff --git a/test/files/pos/bug0029.scala b/test/files/pos/bug0029.scala index 1b33c6cffd..0af45ab62d 100644 --- a/test/files/pos/bug0029.scala +++ b/test/files/pos/bug0029.scala @@ -1,3 +1,3 @@ object Main { - def f[a]: List[List[a]] = for (val l1 <- Nil; val l2 <- Nil) yield l1; + def f[a]: List[List[a]] = for (val l1 <- Nil; val l2 <- Nil) yield l1 } diff --git a/test/files/pos/bug1049.scala b/test/files/pos/bug1049.scala index 452259b9f8..3cc9d0cc58 100644 --- a/test/files/pos/bug1049.scala +++ b/test/files/pos/bug1049.scala @@ -2,6 +2,6 @@ package bug1049 abstract class Test { type T <: A - class A requires T - class B requires T extends A + class A { self: T => } + class B extends A { self: T => } } diff --git a/test/files/pos/bug1050.scala b/test/files/pos/bug1050.scala index 8ca79716a9..1dfa20c988 100644 --- a/test/files/pos/bug1050.scala +++ b/test/files/pos/bug1050.scala @@ -2,7 +2,7 @@ package bug1050 abstract class A { type T <: scala.ScalaObject - class A requires T { + class A { this: T => def b = 3 def c = b b diff --git a/test/files/pos/bug247.scala b/test/files/pos/bug247.scala index bfd9d9694f..e2655c6ab3 100644 --- a/test/files/pos/bug247.scala +++ b/test/files/pos/bug247.scala @@ -16,10 +16,11 @@ class Tree[KEY,Entry](order:Order[KEY]) { def size =0; } -class TreeMap[KEY,VALUE](_factory:TreeMapFactory[KEY]) extends Tree[KEY,Pair[KEY,VALUE]](_factory.order) with Map[KEY, VALUE] { +class TreeMap[KEY,VALUE](_factory:TreeMapFactory[KEY]) extends Tree[KEY,Pair[KEY,VALUE]](_factory.order) with scala.collection.DefaultMap[KEY, VALUE] with Map[KEY, VALUE] { val factory = _factory val order = _factory.order; def this(newOrder:Order[KEY]) = this(new TreeMapFactory[KEY](newOrder)); def get(key:KEY) = null; def elements:Iterator[Pair[KEY,VALUE]] = null; + override def size = super[Tree].size } diff --git a/test/files/pos/bug516.scala b/test/files/pos/bug516.scala.disabled index 67e1799f28..623684e582 100644 --- a/test/files/pos/bug516.scala +++ b/test/files/pos/bug516.scala.disabled @@ -3,7 +3,7 @@ import scala.collection.mutable._; class Members; object subscriber extends Subscriber[Message[String] with Undoable, Members] { - def notify(pub: Members, event: Message[String] with Undoable): Unit = + def notify(pub: Members, event: Message[String] with Undoable): Unit = (event: Message[String]) match { case Include(elem) => Console.println("ADD: " + elem); case Remove(elem) => Console.println("REM: " + elem); @@ -11,4 +11,4 @@ object subscriber extends Subscriber[Message[String] with Undoable, Members] { //case r : Remove [HasTree] with Undoable => } } - + diff --git a/test/files/pos/bug927.scala b/test/files/pos/bug927.scala index 1a906cd9bc..5887aba255 100644 --- a/test/files/pos/bug927.scala +++ b/test/files/pos/bug927.scala @@ -2,7 +2,7 @@ object Test { def sum(stream: Stream[Int]): Int = stream match { - case Stream.empty => 0 + case Stream.Empty => 0 case Stream.cons(hd, tl) => hd + sum(tl) } val str: Stream[Int] = Stream.fromIterator(List(1,2,3).elements) diff --git a/test/files/pos/collections.scala b/test/files/pos/collections.scala.disabled index 4f45a42786..4f45a42786 100644 --- a/test/files/pos/collections.scala +++ b/test/files/pos/collections.scala.disabled diff --git a/test/files/pos/sudoku.scala b/test/files/pos/sudoku.scala index 8f42e56264..9875b22cfd 100644 --- a/test/files/pos/sudoku.scala +++ b/test/files/pos/sudoku.scala @@ -2,7 +2,7 @@ object SudokuSolver extends Application { // The board is represented by an array of strings (arrays of chars), // held in a global variable m. The program begins by reading 9 lines // of input to fill the board - var m: Array[Array[Char]] = List.tabulate(9, (x: Int) => readLine.toArray).toArray + var m: Array[Array[Char]] = Array.tabulate(9)((x: Int) => readLine.toArray) // For printing m, a method print is defined def print = { println(""); m map (carr => println(new String(carr))) } diff --git a/test/files/pos/t0165.scala b/test/files/pos/t0165.scala index 05c4a1c77a..76aef85240 100755 --- a/test/files/pos/t0165.scala +++ b/test/files/pos/t0165.scala @@ -1,5 +1,5 @@ package test3 -import scala.collection.jcl.LinkedHashMap +import scala.collection.mutable.LinkedHashMap trait Main { def asMany : ArrayResult = { diff --git a/test/files/pos/t1049.scala b/test/files/pos/t1049.scala deleted file mode 100755 index dad83579a6..0000000000 --- a/test/files/pos/t1049.scala +++ /dev/null @@ -1,9 +0,0 @@ -class J { - type tttt[a, b] <: _root_.scala.collection.mutable.Map[a, b] - - def r(a : tttt[String, String]) = { - 0 match { - case a : a.MapTo => - } - } -} diff --git a/test/files/pos5/signatures/Test.java b/test/files/pos5/signatures/Test.java index ac34bcea0c..8ecac29910 100644 --- a/test/files/pos5/signatures/Test.java +++ b/test/files/pos5/signatures/Test.java @@ -1,4 +1,4 @@ -import scala.RandomAccessSeq.Mutable; +import scala.collection.mutable.Vector; import test.Outer; /* Test correct generation of java signatures. The Outer class should not diff --git a/test/files/run/bitsets.check b/test/files/run/bitsets.check deleted file mode 100644 index 01bd685eeb..0000000000 --- a/test/files/run/bitsets.check +++ /dev/null @@ -1,33 +0,0 @@ -ms0 = Set(2) -ms1 = Set(2) -ms2 = Set(2) -mb0 = false -mb1 = true -mb2 = false -xs0 = List(2) -xs1 = List(2) -xs2 = List(2) -ma0 = List(4) -ma1 = List(4) -ma2 = List(4) -mi0 = Set(2) -mi1 = Set(2) -mi2 = Set(2) - -is0 = Set() -is1 = Set() -is2 = Set(2) -is3 = Set() -ib0 = false -ib1 = false -ib2 = true -ib3 = false -ys0 = List() -ys1 = List() -ys2 = List(2) -ys3 = List() -ia0 = List(0) -ia1 = List(0) -ia2 = List(4) -ia3 = List() - diff --git a/test/files/run/bitsets.scala b/test/files/run/bitsets.scala deleted file mode 100644 index 469dac31ee..0000000000 --- a/test/files/run/bitsets.scala +++ /dev/null @@ -1,78 +0,0 @@ -//############################################################################ -// Bitsets -//############################################################################ -// $Id$ - -//############################################################################ - -object TestMutable { - import scala.collection.mutable.BitSet - - val ms0 = new BitSet - val ms1 = new BitSet(8) - val ms2 = new BitSet(0) - ms0 += 2 - ms1 ++= List(1, 2) - ms1 -= 1 - ms1 --= List(1) - ms2(2) = true - ms2(3) = false - - Console.println("ms0 = " + ms0) - Console.println("ms1 = " + ms1) - Console.println("ms2 = " + ms2) - - Console.println("mb0 = " + ms0.contains(-1)) - Console.println("mb1 = " + ms1.contains(2)) - Console.println("mb2 = " + ms2.contains(3)) - - Console.println("xs0 = " + ms0.elements.toList) - Console.println("xs1 = " + ms1.elements.toList) - Console.println("xs2 = " + ms2.elements.toList) - - Console.println("ma0 = " + ms0.underlying.toList) - Console.println("ma1 = " + ms1.underlying.toList) - Console.println("ma2 = " + ms2.underlying.toList) - - Console.println("mi0 = " + ms0.toImmutable) - Console.println("mi1 = " + ms1.toImmutable) - Console.println("mi2 = " + ms2.toImmutable) - Console.println -} - -object TestImmutable { - import scala.collection.immutable.BitSet - - val is0 = new BitSet(8, 1, null, false) - val is1 = new BitSet(8, 1, Array(), false) - val is2 = new BitSet(8, 8, Array(4), false) - val is3 = new BitSet(0, 0, null, false) - - Console.println("is0 = " + is0) - Console.println("is1 = " + is1) - Console.println("is2 = " + is2) - Console.println("is3 = " + is3) - - Console.println("ib0 = " + is0.contains(-1)) - Console.println("ib1 = " + is1.contains(0)) - Console.println("ib2 = " + is2.contains(2)) - Console.println("ib3 = " + is3.contains(2)) - - Console.println("ys0 = " + is0.elements.toList) - Console.println("ys1 = " + is1.elements.toList) - Console.println("ys2 = " + is2.elements.toList) - Console.println("ys3 = " + is3.elements.toList) - - Console.println("ia0 = " + is0.underlying.toList) - Console.println("ia1 = " + is1.underlying.toList) - Console.println("ia2 = " + is2.underlying.toList) - Console.println("ia3 = " + is3.underlying.toList) - Console.println -} - -object Test extends Application { - TestMutable - TestImmutable -} - -//############################################################################ diff --git a/test/files/run/bug1074.check b/test/files/run/bug1074.check index 7dc074205c..ecff8510ed 100644 --- a/test/files/run/bug1074.check +++ b/test/files/run/bug1074.check @@ -1,3 +1,3 @@ -q0 = Set(kl, jk, fg, ef, gh, a, cd, de, hj, b, lm, mn) +q0 = Set(kl, jk, cd, fg, a, ef, gh, de, hj, b, lm, mn) q1 = Set() 0 q2 = Set() 0 diff --git a/test/files/run/classof.check b/test/files/run/classof.check index af7082f5b8..0d650b87c0 100644 --- a/test/files/run/classof.check +++ b/test/files/run/classof.check @@ -10,13 +10,13 @@ float double Class types class SomeClass -class scala.List +class scala.collection.immutable.List class scala.Tuple2 Arrays: class [Lscala.runtime.BoxedUnit; class [I class [D -class [Lscala.List; +class [Lscala.collection.immutable.List; Functions: interface scala.Function2 interface scala.Function1 diff --git a/test/files/run/collection-stacks.check b/test/files/run/collection-stacks.check deleted file mode 100644 index fcb39c460c..0000000000 --- a/test/files/run/collection-stacks.check +++ /dev/null @@ -1,14 +0,0 @@ -1-2-3: true -1-2-3: true -apply -1: true -1: true -3: true -3: true -top -3: true -3: true -pop -1-2: true -3: true -1-2: true diff --git a/test/files/run/collection-stacks.scala b/test/files/run/collection-stacks.scala deleted file mode 100644 index ec557cb91d..0000000000 --- a/test/files/run/collection-stacks.scala +++ /dev/null @@ -1,38 +0,0 @@ -import scala.collection._ - -object Test extends Application { - def mutableStack[T](xs: T*): mutable.Stack[T] = { - val s = new mutable.Stack[T] - s.push(xs: _*) - s - } - - def immutableStack[T](xs: T*): immutable.Stack[T] = { - immutable.Stack.Empty push xs - } - - def check[T](expected: T, got: T) { - println(got + ": " + (expected == got)) - } - - // check #957 - check("1-2-3", immutableStack(1, 2, 3).elements.mkString("-")) - check("1-2-3", mutableStack(1, 2, 3).elements.mkString("-")) - - println("apply") - check(1, immutableStack(1, 2, 3).apply(0)) - check(1, mutableStack(1, 2, 3).apply(0)) - check(3, immutableStack(1, 2, 3).apply(2)) - check(3, mutableStack(1, 2, 3).apply(2)) - - println("top") - check(3, immutableStack(1, 2, 3).top) - check(3, mutableStack(1, 2, 3).top) - - println("pop") - check("1-2", immutableStack(1, 2, 3).pop.mkString("-")) - check(3, mutableStack(1, 2, 3).pop()) - check("1-2", { val s = mutableStack(1, 2, 3); s.pop(); s.toList.mkString("-") }) -} - -// vim: set ts=2 sw=2 et: diff --git a/test/files/run/collections.check b/test/files/run/collections.check index 0442e48702..b87a5998c5 100644 --- a/test/files/run/collections.check +++ b/test/files/run/collections.check @@ -32,7 +32,3 @@ test4: 25005003 test1: 14005 test2: 9007003, iters = 3000 test3: 9007003 -***** immutable.UnBalancedTreeMap: -test1: 14005 -test2: 1013003, iters = 1000 -test3: 1013003 diff --git a/test/files/run/collections.scala b/test/files/run/collections.scala index 7c723c9fc7..f286123322 100644 --- a/test/files/run/collections.scala +++ b/test/files/run/collections.scala @@ -113,5 +113,4 @@ object Test extends Application { test("immutable.Map", immutable.Map[Int, Int](), 5000) test("immutable.TreeMap", new immutable.TreeMap[Int, Int], 5000) test("immutable.ListMap", new immutable.ListMap[Int, Int], 3000) - test("immutable.UnBalancedTreeMap", new immutable.UnbalancedTreeMap[Int, Int], 1000) } diff --git a/test/files/run/colltest.scala b/test/files/run/colltest.scala index 65c3676297..5809812838 100644 --- a/test/files/run/colltest.scala +++ b/test/files/run/colltest.scala @@ -46,5 +46,5 @@ class TestSet(s0: Set[Int], s1: Set[Int]) { Console.println("succeeded for "+Iterations+" iterations.") } object Test extends Application { - new TestSet(HashSet.empty, new scala.collection.jcl.LinkedHashSet) + new TestSet(HashSet.empty, new scala.collection.mutable.LinkedHashSet) } diff --git a/test/files/run/constrained-types.scala b/test/files/run/constrained-types.scala index b640db1d67..56fbd749c0 100644 --- a/test/files/run/constrained-types.scala +++ b/test/files/run/constrained-types.scala @@ -89,6 +89,7 @@ object Test { val settings = new Settings settings.Xexperimental.value = true settings.selfInAnnots.value = true + settings.deprecation.value = true val interp = new Interpreter(settings) diff --git a/test/files/run/deeps.check b/test/files/run/deeps.check deleted file mode 100644 index f1925fcbc1..0000000000 --- a/test/files/run/deeps.check +++ /dev/null @@ -1,83 +0,0 @@ -false -false -true - -false -false -true - -x=Array(1) -y=Array(1) -false -false -true - -x=Array(Array(1), Array(1)) -y=Array(Array(1), Array(1)) -false -false -true - -x=Array(Array(Array(1), Array(1)), Array(Array(1), Array(1))) -y=Array(Array(Array(1), Array(1)), Array(Array(1), Array(1))) -false -false -true - -false -false -true -false -false -true -Array(true, false) -Array(true, false) -[true;false] -true;false - -Array([Z@0000000, [Z@0000000) -Array(Array(true, false), Array(true, false)) -[[true;false];[true;false]] -true;false;true;false - -Array([[Z@0000000, [[Z@0000000) -Array(Array(Array(true, false), Array(true, false)), Array(Array(true, false), Array(true, false))) -[[[true;false];[true;false]];[[true;false];[true;false]]] -true;false;true;false;true;false;true;false - -Array(1.0, 0.0) -Array(1.0, 0.0) -[1.0;0.0] -1.0;0.0 - -Array([D@0000000, [D@0000000) -Array(Array(1.0, 0.0), Array(1.0, 0.0)) -[[1.0;0.0];[1.0;0.0]] -1.0;0.0;1.0;0.0 - -Array([[D@0000000, [[D@0000000) -Array(Array(Array(1.0, 0.0), Array(1.0, 0.0)), Array(Array(1.0, 0.0), Array(1.0, 0.0))) -[[[1.0;0.0];[1.0;0.0]];[[1.0;0.0];[1.0;0.0]]] -1.0;0.0;1.0;0.0;1.0;0.0;1.0;0.0 - -Array(a, b) -Array(a, b) -[a;b] -a;b - -Array([Ljava.lang.String;@0000000, [Ljava.lang.String;@0000000) -Array(Array(a, b), Array(a, b)) -[[a;b];[a;b]] -a;b;a;b - -Array([[Ljava.lang.String;@0000000, [[Ljava.lang.String;@0000000) -Array(Array(Array(a, b), Array(a, b)), Array(Array(a, b), Array(a, b))) -[[[a;b];[a;b]];[[a;b];[a;b]]] -a;b;a;b;a;b;a;b - -[[true; false]; [false]] -[[1; 2]; [3]] -[[1; 2]; [3]] - -Array(boo, and, foo) -Array(a) diff --git a/test/files/run/deeps.scala b/test/files/run/deeps.scala deleted file mode 100644 index e592c4ea25..0000000000 --- a/test/files/run/deeps.scala +++ /dev/null @@ -1,112 +0,0 @@ -//############################################################################ -// deepEquals / deepToString -//############################################################################ -// $Id: $ - -//############################################################################ - -object Test extends Application { - - def testEquals1 { - println(Array(1) == Array(1)) - println(Array(1) equals Array(1)) - println(Array(1) deepEquals Array(1)) - println - } - - def testEquals2 { - println(Array(Array(1), Array(2)) == Array(Array(1), Array(2))) - println(Array(Array(1), Array(2)) equals Array(Array(1), Array(2))) - println(Array(Array(1), Array(2)) deepEquals Array(Array(1), Array(2))) - println - } - - def testEquals3 { - val a1 = Array(1) - val b1 = Array(1) - val a2 = Array(a1, b1) - val b2 = Array(a1, b1) - val a3 = Array(a2, b2) - val b3 = Array(a2, b2) - def test[T](x: Array[T], y: Array[T]) { - println("x=" + x.deepToString) - println("y=" + y.deepToString) - println(x == y) - println(x equals y) - println(x deepEquals y) - println - } - test(a1, b1) - test(a2, b2) - test(a3, b3) - } - - def testEquals4 { - println("boo:and:foo".split(':') == "boo:and:foo".split(':')) - println("boo:and:foo".split(':') equals "boo:and:foo".split(':')) - println("boo:and:foo".split(':') deepEquals "boo:and:foo".split(':')) - - val xs = new java.util.ArrayList[String](); xs.add("a") - val ys = new java.util.ArrayList[String](); ys.add("a") - println(xs.toArray == ys.toArray) - println(xs.toArray equals ys.toArray) - println(xs.toArray deepEquals ys.toArray) - } - - def testToString1 { - def sweep(s: String) = - s.replaceAll("D@[0-9a-fA-F]+", "D@0000000") - .replaceAll("Z@[0-9a-fA-F]+", "Z@0000000") - .replaceAll(";@[0-9a-fA-F]+", ";@0000000") - def test[T](a: Array[T]) { - println(sweep(a.toString)) - println(a.deepToString) - println(a.deepMkString("[", ";", "]")) - println(a.deepMkString(";")) - println - } - - val ba1 = Array(true, false) - val ba2 = Array(ba1, ba1) - val ba3 = Array(ba2, ba2) - test(ba1) - test(ba2) - test(ba3) - - val da1 = Array(1.0d, 0.0d) - val da2 = Array(da1, da1) - val da3 = Array(da2, da2) - test(da1) - test(da2) - test(da3) - - val sa1 = Array("a", "b") - val sa2 = Array(sa1, sa1) - val sa3 = Array(sa2, sa2) - test(sa1) - test(sa2) - test(sa3) - } - - def testToString2 { - println(Array(Array(true, false), Array(false)).deepMkString("[", "; ", "]")) - println(Array(Array('1', '2'), Array('3')).deepMkString("[", "; ", "]")) - println(Array(Array(1, 2), Array(3)).deepMkString("[", "; ", "]")) - println - } - - def testToString3 { - println("boo:and:foo".split(':').deepToString) - - val xs = new java.util.ArrayList[String](); xs.add("a") - println(xs.toArray.deepToString) - } - - testEquals1 - testEquals2 - testEquals3 - testEquals4 - testToString1 - testToString2 - testToString3 -} diff --git a/test/files/run/forvaleq.check b/test/files/run/forvaleq.check deleted file mode 100644 index ec57719cb4..0000000000 --- a/test/files/run/forvaleq.check +++ /dev/null @@ -1,5 +0,0 @@ -List(2, 6, 10, 14, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38) -List(2, 6, 10, 14, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) -List(2, 6, 10, 14, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38) -List(2, 6, 10, 14, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) -called 20 times diff --git a/test/files/run/forvaleq.scala b/test/files/run/forvaleq.scala deleted file mode 100644 index 1e4fd33dbc..0000000000 --- a/test/files/run/forvaleq.scala +++ /dev/null @@ -1,92 +0,0 @@ -// test "foo = expr" clauses in for comprehensions -// $Id$ - -import scala.collection.immutable.Queue -import scala.{List=>L} - -object Test { - // redefine some symbols to make it extra hard - class List - class Tuple2 - def List[A](as: A*) = 5 - - def firstDigit(x: Int): Int = - x match { - case 0 => 0 - case _ if (x<0) => firstDigit(-x) - case _ if (x<10) => x - case _ => firstDigit(x / 10) - } - - - { - // a basic test case - - val input = L.range(0,20) - val oddFirstTimesTwo = - for {x <- input - xf = firstDigit(x) - if xf % 2 == 1} - yield x*2 - println(oddFirstTimesTwo) - } - - { - // a test case with patterns - - val input = L.range(0, 20) - val oddFirstTimesTwo = - for {x <- input - xf = firstDigit(x) - yf = x - firstDigit(x) / 10 - (a, b) = (xf - yf, xf + yf) - if xf % 2 == 1} - yield a + b - println(oddFirstTimesTwo) - } - - { - // make sure it works on non-Ls - - // val input: Queue = Queue.Empty[int].incl(L.range(0,20)) - val input = L.range(0, 20).elements - val oddFirstTimesTwo = - for {x <- input - xf = firstDigit(x) - if xf % 2 == 1} - yield x*2 - println(oddFirstTimesTwo.toList) - } - - { - // yield the computed value - - val input = L.range(0,20) - val oddFirstTimesTwo = - for {x <- input - xf = firstDigit(x) - if xf % 2 == 1} - yield xf*2 - println(oddFirstTimesTwo) - } - - { - // make sure the function is only called once - var count: Int = 0 - - def fdct(x: Int) = { - count += 1 - firstDigit(x) - } - - val input = L.range(0,20) - for {x <- input - xf = fdct(x) - if xf % 2 == 1} - yield xf - - println("called " + count + " times") - } - - def main(args: Array[String]) {} -} diff --git a/test/files/run/infiniteloop.check b/test/files/run/infiniteloop.check index be0b1437f1..6f8cf6e4d9 100644 --- a/test/files/run/infiniteloop.check +++ b/test/files/run/infiniteloop.check @@ -1 +1 @@ -Stream(512, ?) +Stream(512, 256, 128, 64, 32, 16, 8, 4, 2, 1) diff --git a/test/files/run/iq.check b/test/files/run/iq.check deleted file mode 100644 index 81114ea181..0000000000 --- a/test/files/run/iq.check +++ /dev/null @@ -1,12 +0,0 @@ -Empty -Head: 42 -q5: Queue(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) -q5[5]: 5 -q5 == q5c: true -q5c == q5: true -q8: Queue(2, 3, 4, 5, 6, 7, 8, 9, 10, 11) -q8 == q9: true -Elements: 1 2 3 4 5 6 7 8 9 -String: <1-2-3-4-5-6-7-8-9> -Length: 9 -Front: 1 diff --git a/test/files/run/iq.scala b/test/files/run/iq.scala deleted file mode 100644 index 8ae3dbb080..0000000000 --- a/test/files/run/iq.scala +++ /dev/null @@ -1,100 +0,0 @@ -/* $Id$ - * Test file for immutable queues. - */ - -import scala.collection.immutable.Queue - -object iq { - def main { - /* Create an empty queue. */ - val q: Queue[Int] = Queue.Empty - - /* Test isEmpty. - * Expected: Empty - */ - if (q.isEmpty) { - Console.println("Empty") - } - - /* Test infix enqueing. */ - //val q2 = q + 42 + 0 // deprecated - val q2 = q.enqueue(42).enqueue(0) - - /* Test is empty and dequeue. - * Expected: Head: 42 - */ - val q4 = - if (q2.isEmpty) { - Console.println("Empty") - q2 - } - else { - val (head, q3) = q2.dequeue - Console.println("Head: " + head) - q3 - } - - /* Test sequence enqueing. */ - val q5: Queue[Any] = q4.enqueue(List(1,2,3,4,5,6,7,8,9)) - /* Test toString. - * Expected: Head: q5: Queue(0,1,2,3,4,5,6,7,8,9) - */ - Console.println("q5: " + q5) - /* Test apply - * Expected: q5[5]: 5 - */ - Console.println("q5[5]: " + q5(5)) - - val q5c: Queue[Int] = Queue.Empty.enqueue(List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)) - - /* Testing == - * Expected: q5 == q9: true - * q9 == q5: true - */ - Console.println("q5 == q5c: " + (q5 == q5c)) - Console.println("q5c == q5: " + (q5c == q5)) - - val (_, q6) = q5.dequeue - val (_, q7) = q6.dequeue - //val q8 = q7 + 10 + 11 //deprecated - val q8 = q7.enqueue(10).enqueue(11) - /* Test dequeu - * Expected: q8: Queue(2,3,4,5,6,7,8,9,10,11) - */ - Console.println("q8: " + q8) - val q9 = new Queue(2,3,4,5,6,7,8,9,10,11) - - /* Testing == - * Expected: q8 == q9: true - */ - Console.println("q8 == q9: " + (q8 == q9)) - - /* Testing elements - * Expected: Elements: 1 2 3 4 5 6 7 8 9 - */ - Console.print("Elements: "); - q6.elements.foreach(e => Console.print(" "+ e + " ")) - Console.println; - - /* Testing mkString - * Expected: String: <1-2-3-4-5-6-7-8-9> - */ - Console.println("String: " + q6.mkString("<","-",">")) - - /* Testing length - * Expected: Length: 9 - */ - Console.println("Length: " + q6.length) - - /* Testing front - * Expected: Front: 1 - */ - Console.println("Front: " + q6.front); - } -} - -object Test { - def main(args: Array[String]) { - iq.main - } -} diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala index 615046bf14..3840b44b86 100644 --- a/test/files/run/patmatnew.scala +++ b/test/files/run/patmatnew.scala @@ -311,7 +311,7 @@ object Test extends TestConsoleMain { object TestStream extends TestCase("unapply for Streams") { def sum(stream: Stream[Int]): Int = stream match { - case Stream.empty => 0 + case Stream.Empty => 0 case Stream.cons(hd, tl) => hd + sum(tl) } diff --git a/test/files/run/range.scala b/test/files/run/range.scala index 5d0ca84c0b..18f3ace645 100644 --- a/test/files/run/range.scala +++ b/test/files/run/range.scala @@ -2,7 +2,7 @@ object Test extends Application{ def rangeForeach(range : Range) = { val buffer = new scala.collection.mutable.ListBuffer[Int]; range.foreach(buffer += _); - assert(buffer.toList == range.elements.toList); + assert(buffer.toList == range.elements.toList, buffer.toList+"/"+range.elements.toList) } rangeForeach(1 to 10); diff --git a/test/files/run/t0485.check b/test/files/run/t0485.check deleted file mode 100644 index 3a462cfdc1..0000000000 --- a/test/files/run/t0485.check +++ /dev/null @@ -1,32 +0,0 @@ -m1={(10,20), (20,30)} -m2={(10,20)} -m1.size > m2.size is true -m1 equals m2 is true - -m1={(10,20), (20,30)} -m2={(10,20)} -m1.size > m2.size is true -m1 equals m2 is true - -m1={(10,20), (20,30)} -m2={(10,20)} -m1.size > m2.size is true -m1 equals m2 is true - -java.lang.CloneNotSupportedException: The underlying map doesn't implement the Cloneable interface - -s1=[10, 20] -s2=[10] -s1.size > s2 is true -s1 equals s2 is true - -s1=[10, 20] -s2=[10] -s1.size > s2 is true -s1 equals s2 is true - -s1=[10, 20] -s2=[10] -s1.size > s2 is true -s1 equals s2 is true - diff --git a/test/files/run/t0485.scala b/test/files/run/t0485.scala deleted file mode 100644 index 9e2017aacc..0000000000 --- a/test/files/run/t0485.scala +++ /dev/null @@ -1,54 +0,0 @@ -import scala.collection.jcl - -object Test extends Application { - testMap - testSet -} - -object testMap { - def toString(m1: collection.Map[Int, Int]): String = - m1.toList.sort((x, y) => x < y).mkString("{", ", ", "}") - def test(m1: jcl.Map[Int, Int]) { - try { - m1.put(10, 20) - val m2 = m1.clone() - m1.put(20, 30) - println("m1="+toString(m1)) - println("m2="+toString(m2)) - println("m1.size > m2.size is "+ (m1.size > m2.size)) - m1.remove((20, 30)) - println("m1 equals m2 is "+ (m1 equals m2)) - println() - } - catch { - case e: Exception => - println(e); println() - } - } - test(new jcl.HashMap[Int, Int]) - // Clone on IdentityHashMap of java-ibm-1.6 behaves differently than all others - // Therefore, for now we will not perform this test on it. - // test(new jcl.IdentityHashMap[Int, Int]) - test(new jcl.LinkedHashMap[Int, Int]) - test(new jcl.TreeMap[Int, Int]) - test(new jcl.WeakHashMap[Int, Int]) -} - -object testSet { - def toString(s1: collection.Set[Int]): String = - s1.toList.sort((x, y) => x < y).mkString("[", ", ", "]") - def test(s1: jcl.Set[Int]) { - s1.add(10) - val s2 = s1.clone() - s1.add(20) - println("s1="+toString(s1)) - println("s2="+toString(s2)) - println("s1.size > s2 is "+ (s1.size > s2.size)) - s1.remove(20) - println("s1 equals s2 is "+ (s1 equals s2)) - println() - } - test(new jcl.HashSet[Int]) - test(new jcl.LinkedHashSet[Int]) - test(new jcl.TreeSet[Int]) -} diff --git a/test/files/run/t1323.scala b/test/files/run/t1323.scala index 7a68482101..d84239a12c 100644 --- a/test/files/run/t1323.scala +++ b/test/files/run/t1323.scala @@ -1,25 +1,25 @@ object Test extends Application { - println(" 1:" + List(1,2,3,4).indexOf(List(0,1))) // -1 - println(" 2:" + List(1,2,3,4).indexOf(List(1,2))) // 0 - println(" 3:" + List(1,2,3,4).indexOf(List(2,3))) // 1 - println(" 4:" + List(1,2,3,4).indexOf(List(3,4))) // 2 - println(" 5:" + List(1,2,3,4).indexOf(List(4,5))) // -1 - println(" 6:" + List(1,2,3,4).indexOf(List(2,4))) // -1 - println(" 7:" + List(1,2,3,4).indexOf(List(4,3))) // -1 - println(" 8:" + List(1,2,3,4).indexOf(List(1,3))) // -1 - println(" 9:" + List(1,2,3,4).indexOf(List(1,3))) // -1 - println("10:" + List(1,2,3,4).indexOf(List(1,2,3,4))) // 0 - println("11:" + List(1,2,3,4).indexOf(List(4,3,2,1))) // -1 - println("12:" + List(1,2,3,4).indexOf(List(1,2,3,4,5))) // -1 - println("13:" + List(1,2,3,4).indexOf(List(5,4,3,2,1))) // -1 - println("14:" + List(1,2,3,4).indexOf(List())) // 0 - println("15:" + List().indexOf(List())) // 0 - println("16:" + List().indexOf(List(1,2,3,4))) // -1 + println(" 1:" + List(1,2,3,4).indexOfSeq(List(0,1))) // -1 + println(" 2:" + List(1,2,3,4).indexOfSeq(List(1,2))) // 0 + println(" 3:" + List(1,2,3,4).indexOfSeq(List(2,3))) // 1 + println(" 4:" + List(1,2,3,4).indexOfSeq(List(3,4))) // 2 + println(" 5:" + List(1,2,3,4).indexOfSeq(List(4,5))) // -1 + println(" 6:" + List(1,2,3,4).indexOfSeq(List(2,4))) // -1 + println(" 7:" + List(1,2,3,4).indexOfSeq(List(4,3))) // -1 + println(" 8:" + List(1,2,3,4).indexOfSeq(List(1,3))) // -1 + println(" 9:" + List(1,2,3,4).indexOfSeq(List(1,3))) // -1 + println("10:" + List(1,2,3,4).indexOfSeq(List(1,2,3,4))) // 0 + println("11:" + List(1,2,3,4).indexOfSeq(List(4,3,2,1))) // -1 + println("12:" + List(1,2,3,4).indexOfSeq(List(1,2,3,4,5))) // -1 + println("13:" + List(1,2,3,4).indexOfSeq(List(5,4,3,2,1))) // -1 + println("14:" + List(1,2,3,4).indexOfSeq(List())) // 0 + println("15:" + List().indexOfSeq(List())) // 0 + println("16:" + List().indexOfSeq(List(1,2,3,4))) // -1 // Do some testing with infinite sequences def from(n: Int): Stream[Int] = Stream.cons(n, from(n + 1)) - println("17:" + List(1,2,3,4).indexOf(from(1))) // -1 - println("18:" + from(1).indexOf(List(4,5,6))) // 3 + println("17:" + List(1,2,3,4).indexOfSeq(from(1))) // -1 + println("18:" + from(1).indexOfSeq(List(4,5,6))) // 3 } diff --git a/test/files/run/unapply.scala b/test/files/run/unapply.scala index 3325d034d3..f540b2a2a9 100644 --- a/test/files/run/unapply.scala +++ b/test/files/run/unapply.scala @@ -107,7 +107,7 @@ object StreamFoo extends TestCase("unapply for Streams") with Assert { def sum(stream: Stream[Int]): Int = stream match { - case Stream.empty => 0 + case Stream.Empty => 0 case Stream.cons(hd, tl) => hd + sum(tl) } override def runTest { diff --git a/test/files/run/unittest_collection.scala b/test/files/run/unittest_collection.scala deleted file mode 100644 index 5d7ab97425..0000000000 --- a/test/files/run/unittest_collection.scala +++ /dev/null @@ -1,103 +0,0 @@ - -object Test { - - import scala.testing.SUnit._ - import scala.collection.mutable.{ArrayBuffer, Buffer, BufferProxy, ListBuffer} - - trait BufferTest extends Assert { - def doTest(x:Buffer[String]) = { - // testing method += - x += "one" - assertEquals("retrieving 'one'", x(0), "one") - assertEquals("length A ", x.length, 1) - x += "two" - assertEquals("retrieving 'two'", x(1), "two") - assertEquals("length B ", x.length, 2) - - // testing method -= (removing last element) - x -= "two" - - assertEquals("length C ", x.length, 1) - - try { x(1); fail("no exception for removed element") } - catch { case i:IndexOutOfBoundsException => } - - try { x.remove(1); fail("no exception for removed element") } - catch { case i:IndexOutOfBoundsException => } - - x += "two2" - assertEquals("length D ", x.length, 2) - - // removing first element - x.remove(0) - assertEquals("length E ", x.length, 1) - - // toList - assertEquals("toList ", x.toList, List("two2")) - - // clear - x.clear - assertEquals("length F ", x.length, 0) - - // copyToBuffer - x += "a" - x += "b" - val dest = new ArrayBuffer[String] - x copyToBuffer dest - assertEquals("dest", List("a", "b"), dest.toList) - assertEquals("source", List("a", "b"), x.toList) - } - } - - class TArrayBuffer extends TestCase("collection.mutable.ArrayBuffer") with Assert with BufferTest { - - var x: ArrayBuffer[String] = _ - - override def runTest = { setUp; doTest(x); tearDown } - - override def setUp = { x = new scala.collection.mutable.ArrayBuffer } - - override def tearDown = { x.clear; x = null } - } - - class TListBuffer extends TestCase("collection.mutable.ListBuffer") with Assert with BufferTest { - - var x: ListBuffer[String] = _ - - override def runTest = { setUp; doTest(x); tearDown } - - override def setUp = { x = new scala.collection.mutable.ListBuffer } - - override def tearDown = { x.clear; x = null } - - } - - class TBufferProxy extends TestCase("collection.mutable.BufferProxy") with Assert with BufferTest { - - class BBuf(z:ListBuffer[String]) extends BufferProxy[String] { - def self = z - } - - var x: BufferProxy[String] = _ - - override def runTest = { setUp; doTest(x); tearDown } - - override def setUp = { x = new BBuf(new scala.collection.mutable.ListBuffer) } - - override def tearDown = { x.clear; x = null } - - } - - def main(args:Array[String]) = { - val ts = new TestSuite( - //new TArrayBuffer, - new TListBuffer//, - //new TBufferProxy - ) - val tr = new TestResult() - ts.run(tr) - for(val failure <- tr.failures) { - Console.println(failure) - } - } -} diff --git a/test/files/run/withIndex.scala b/test/files/run/withIndex.scala index 6d470878d9..f0c3e7a468 100644 --- a/test/files/run/withIndex.scala +++ b/test/files/run/withIndex.scala @@ -19,7 +19,7 @@ object Test { val emptyArray = new Array[String](0) val emptyList: List[String] = Nil val emptyIterator = emptyList.elements - val emptyStream = Stream.empty + val emptyStream: Stream[String] = Stream.empty Console.println(emptyArray.zipWithIndex.toList) Console.println(emptyList.zipWithIndex.toList) diff --git a/test/files/scalacheck/list.scala b/test/files/scalacheck/list.scala deleted file mode 100644 index 93d3a59458..0000000000 --- a/test/files/scalacheck/list.scala +++ /dev/null @@ -1,10 +0,0 @@ -import org.scalacheck._ -import Prop._ - -object Test { - val prop_ConcatLists = - property((l1: List[Int], l2: List[Int]) => (l1.size + l2.size) == (l1 ::: l2).size) - - val tests = List(("ConcatLists", prop_ConcatLists)) -} - diff --git a/test/files/scalap/caseClass/A.scala b/test/files/scalap/caseClass/A.scala deleted file mode 100644 index 3addfbdaaa..0000000000 --- a/test/files/scalap/caseClass/A.scala +++ /dev/null @@ -1,3 +0,0 @@ -case class CaseClass[A <: Seq[Int]](i: A, s: String) { - def foo = 239 -}
\ No newline at end of file diff --git a/test/files/scalap/caseClass/result.test b/test/files/scalap/caseClass/result.test deleted file mode 100644 index 5057f87a3f..0000000000 --- a/test/files/scalap/caseClass/result.test +++ /dev/null @@ -1,11 +0,0 @@ -case class CaseClass[A >: scala.Nothing <: scala.Seq[scala.Int]](a : A, s : scala.Predef.String) extends java.lang.Object with scala.ScalaObject with scala.Product { - val i : A = { /* compiled code */ } - val s : scala.Predef.String = { /* compiled code */ } - def foo : scala.Int = { /* compiled code */ } - override def hashCode() : scala.Int = { /* compiled code */ } - override def toString() : scala.Predef.String = { /* compiled code */ } - override def equals(a : scala.Any) : scala.Boolean = { /* compiled code */ } - override def productPrefix : java.lang.String = { /* compiled code */ } - override def productArity : scala.Int = { /* compiled code */ } - override def productElement(i : scala.Int) : scala.Any = { /* compiled code */ } -}
\ No newline at end of file diff --git a/test/files/scalap/classWithExistential/A.scala b/test/files/scalap/classWithExistential/A.scala deleted file mode 100644 index 2a77a842c9..0000000000 --- a/test/files/scalap/classWithExistential/A.scala +++ /dev/null @@ -1,3 +0,0 @@ -class ClassWithExistential { - def foo[A, B] : A=> B forSome {type A <: Seq[Int]; type B >: String} = null -}
\ No newline at end of file diff --git a/test/files/scalap/classWithExistential/result.test b/test/files/scalap/classWithExistential/result.test deleted file mode 100644 index 377edff7ef..0000000000 --- a/test/files/scalap/classWithExistential/result.test +++ /dev/null @@ -1,4 +0,0 @@ -class ClassWithExistential extends java.lang.Object with scala.ScalaObject { - def this() = { /* compiled code */ } - def foo[A >: scala.Nothing <: scala.Any, B >: scala.Nothing <: scala.Any] : scala.Function1[A, B forSome {type A >: scala.Nothing <: scala.Seq[scala.Int]; type B >: scala.Predef.String <: scala.Any}] = { /* compiled code */ } -}
\ No newline at end of file diff --git a/test/files/scalap/paramNames/A.scala b/test/files/scalap/paramNames/A.scala deleted file mode 100644 index 7ba9ff0feb..0000000000 --- a/test/files/scalap/paramNames/A.scala +++ /dev/null @@ -1,3 +0,0 @@ -class ParamNames { - def foo (s: => Seq[Int], s2: => Seq[Any]) {} -} diff --git a/test/files/scalap/paramNames/result.test b/test/files/scalap/paramNames/result.test deleted file mode 100644 index 2d59f72ec1..0000000000 --- a/test/files/scalap/paramNames/result.test +++ /dev/null @@ -1,4 +0,0 @@ -class ParamNames extends java.lang.Object with scala.ScalaObject { - def this() = { /* compiled code */ } - def foo(s : => scala.Seq[scala.Int], s : => scala.Seq[scala.Any]) : scala.Unit = { /* compiled code */ } -}
\ No newline at end of file diff --git a/test/files/script/fact.args b/test/files/script/fact.args deleted file mode 100644 index 7813681f5b..0000000000 --- a/test/files/script/fact.args +++ /dev/null @@ -1 +0,0 @@ -5
\ No newline at end of file diff --git a/test/files/script/fact.bat b/test/files/script/fact.bat deleted file mode 100755 index bee0ba25c6..0000000000 --- a/test/files/script/fact.bat +++ /dev/null @@ -1,17 +0,0 @@ -::#!
-:: fact - A simple Scala batch file that prints out the factorial
-:: of the argument specified on the command line.
-
-@echo off
-call scala -nocompdaemon %0 %*
-goto :eof
-::!#
-
-
-val x = argv(0).toInt
-
-def fact(x: Int):Int =
- if(x==0) 1
- else x*fact(x-1)
-
-Console.println("fact(" + x + ") = " + fact(x))
diff --git a/test/files/script/fact.check b/test/files/script/fact.check deleted file mode 100644 index 22aa60821e..0000000000 --- a/test/files/script/fact.check +++ /dev/null @@ -1 +0,0 @@ -fact(5) = 120 diff --git a/test/files/script/fact.scala b/test/files/script/fact.scala deleted file mode 100644 index d48dac6f0f..0000000000 --- a/test/files/script/fact.scala +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# fact - A simple Scala script that prints out the factorial of -# the argument specified on the command line. - -cygwin=false; -case "`uname`" in - CYGWIN*) cygwin=true ;; -esac - -SOURCE="$0"; -if $cygwin; then - if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then - format=mixed - else - format=windows - fi - SOURCE=`cygpath --$format "$SOURCE"`; -fi - -exec scala -nocompdaemon "$SOURCE" "$@" -!# - - -val x = argv(0).toInt - -def fact(x: Int):Int = - if(x==0) 1 - else x*fact(x-1) - -Console.println("fact(" + x + ") = " + fact(x)) |