diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2009-05-27 19:35:02 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2009-05-27 19:35:02 +0000 |
commit | cc5e79c9ec9cea8d0f22020b528877d8f6e00153 (patch) | |
tree | 94e43f77c7b7271b3d0b6f9fb7372ae83b39360d /test | |
parent | 4b8be5d8bec86358276407d6521c41702ccda835 (diff) | |
download | scala-cc5e79c9ec9cea8d0f22020b528877d8f6e00153.tar.gz scala-cc5e79c9ec9cea8d0f22020b528877d8f6e00153.tar.bz2 scala-cc5e79c9ec9cea8d0f22020b528877d8f6e00153.zip |
In "Iterable" and in all its subclasses, "itera...
In "Iterable" and in all its subclasses, "iterator" replaces "elements"
(and assorted changes).
Diffstat (limited to 'test')
38 files changed, 64 insertions, 90 deletions
diff --git a/test/disabled/jvm/serialization.scala b/test/disabled/jvm/serialization.scala index 609210e64a..6caf8209ff 100755 --- a/test/disabled/jvm/serialization.scala +++ b/test/disabled/jvm/serialization.scala @@ -38,7 +38,7 @@ object Serialize { object Test1_scala { private def arrayToString[A](arr: Array[A]): String = - List.fromArray(arr).mkString("Array[",",","]") + arr.mkString("Array[",",","]") private def arrayEquals[A, B](a1: Array[A], a2: Array[B]): Boolean = (a1.length == a2.length) && @@ -282,7 +282,7 @@ object Test4_xml { <th>Last Name</th> <th>First Name</th> </tr> - { for (val p <- people) yield + { for (p <- people) yield <tr> <td> { p.name } </td> <td> { p.age.toString() } </td> diff --git a/test/disabled/run/collection-stacks.scala b/test/disabled/run/collection-stacks.scala index 665fb91e13..b159be07aa 100644 --- a/test/disabled/run/collection-stacks.scala +++ b/test/disabled/run/collection-stacks.scala @@ -16,8 +16,8 @@ object Test extends Application { } // check #957 - check("1-2-3", immutableStack(1, 2, 3).elements.mkString("-")) - check("1-2-3", mutableStack(1, 2, 3).elements.mkString("-")) + check("1-2-3", immutableStack(1, 2, 3).iterator.mkString("-")) + check("1-2-3", mutableStack(1, 2, 3).iterator.mkString("-")) println("apply") check(1, immutableStack(1, 2, 3).apply(0)) diff --git a/test/disabled/run/forvaleq.scala b/test/disabled/run/forvaleq.scala index 1e4fd33dbc..80d41acd85 100644 --- a/test/disabled/run/forvaleq.scala +++ b/test/disabled/run/forvaleq.scala @@ -49,7 +49,7 @@ object Test { // 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 input = L.range(0, 20).iterator val oddFirstTimesTwo = for {x <- input xf = firstDigit(x) diff --git a/test/disabled/run/iq.scala b/test/disabled/run/iq.scala index 8ae3dbb080..b07da22fe6 100644 --- a/test/disabled/run/iq.scala +++ b/test/disabled/run/iq.scala @@ -73,7 +73,7 @@ object iq { * Expected: Elements: 1 2 3 4 5 6 7 8 9 */ Console.print("Elements: "); - q6.elements.foreach(e => Console.print(" "+ e + " ")) + q6.iterator.foreach(e => Console.print(" "+ e + " ")) Console.println; /* Testing mkString diff --git a/test/files/jvm/xml01.scala b/test/files/jvm/xml01.scala index 7246c94c5b..e305f516d7 100644 --- a/test/files/jvm/xml01.scala +++ b/test/files/jvm/xml01.scala @@ -57,8 +57,8 @@ object Test extends Application with Assert { /* Console.println( parsedxml2 \ "_" ); - Console.println( (parsedxml2 \ "_" ).elements); - for( val i <- (parsedxml2 \ "_" ).elements) { + Console.println( (parsedxml2 \ "_" ).iterator); + for( val i <- (parsedxml2 \ "_" ).iterator) { Console.println( i ); }; */ diff --git a/test/files/neg/bug112706A.check b/test/files/neg/bug112706A.check index f84dbcd051..8fb5bfc390 100644 --- a/test/files/neg/bug112706A.check +++ b/test/files/neg/bug112706A.check @@ -1,10 +1,6 @@ -bug112706A.scala:4: warning: for (val x <- ... ) has been deprecated; use for (x <- ... ) instead - for (val t <- p) t._1 match { - ^ bug112706A.scala:5: error: constructor cannot be instantiated to expected type; found : (T1, T2) required: java.lang.String case Tuple2(node,_) => ^ -one warning found one error found diff --git a/test/files/neg/bug112706A.scala b/test/files/neg/bug112706A.scala index fb98ad300c..af8491e6ef 100644 --- a/test/files/neg/bug112706A.scala +++ b/test/files/neg/bug112706A.scala @@ -1,7 +1,7 @@ package test; trait Test { def foo(p : List[Tuple2[String,String]]) = { - for (val t <- p) t._1 match { + for (t <- p) t._1 match { case Tuple2(node,_) => } } diff --git a/test/files/neg/bug563.check b/test/files/neg/bug563.check index b88c949883..c10f504635 100644 --- a/test/files/neg/bug563.check +++ b/test/files/neg/bug563.check @@ -1,8 +1,4 @@ -bug563.scala:5: warning: for (val x <- ... ) has been deprecated; use for (x <- ... ) instead - for (val n <- sn) - ^ bug563.scala:6: error: missing parameter type map(n,ptr => new Cell(ptr.elem)); ^ -one warning found one error found diff --git a/test/files/neg/bug563.scala b/test/files/neg/bug563.scala index d559226bdb..d8e026e656 100644 --- a/test/files/neg/bug563.scala +++ b/test/files/neg/bug563.scala @@ -2,6 +2,6 @@ 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 = - for (val n <- sn) + for (n <- sn) map(n,ptr => new Cell(ptr.elem)); } diff --git a/test/files/neg/bug765.check b/test/files/neg/bug765.check index f022c72f94..02bd111ef7 100644 --- a/test/files/neg/bug765.check +++ b/test/files/neg/bug765.check @@ -1,8 +1,4 @@ -bug765.scala:2: warning: for (val x <- ... ) has been deprecated; use for (x <- ... ) instead - for (val e <- List()) { //required - ^ bug765.scala:3: error: not found: type Bar123 val bar = new Bar123 ^ -one warning found one error found diff --git a/test/files/neg/bug765.scala b/test/files/neg/bug765.scala index f1100df55a..3e5371b533 100644 --- a/test/files/neg/bug765.scala +++ b/test/files/neg/bug765.scala @@ -1,5 +1,5 @@ object test { - for (val e <- List()) { //required + for (e <- List()) { //required val bar = new Bar123 val res = bar.f //required () diff --git a/test/files/neg/bug766.check b/test/files/neg/bug766.check index 3900f782ca..d259db6835 100644 --- a/test/files/neg/bug766.check +++ b/test/files/neg/bug766.check @@ -1,8 +1,4 @@ -bug766.scala:4: warning: for (val x <- ... ) has been deprecated; use for (x <- ... ) instead - for (val n <- Nil; val m <- Nil) { - ^ bug766.scala:5: error: not found: value badIdentifier val p = badIdentifier ^ -one warning found one error found diff --git a/test/files/neg/bug766.scala b/test/files/neg/bug766.scala index 9829b23217..b4b04d9642 100644 --- a/test/files/neg/bug766.scala +++ b/test/files/neg/bug766.scala @@ -1,7 +1,7 @@ object B { def a = { - for (val n <- Nil; val m <- Nil) { + for (n <- Nil; m <- Nil) { val p = badIdentifier false } diff --git a/test/files/neg/viewtest.check b/test/files/neg/viewtest.check index 9ae41b7728..5415ba4f92 100644 --- a/test/files/neg/viewtest.check +++ b/test/files/neg/viewtest.check @@ -1,12 +1,3 @@ -viewtest.scala:96: warning: for (val x <- ... ) has been deprecated; use for (x <- ... ) instead - for (val s <- args) { - ^ -viewtest.scala:103: warning: for (val x <- ... ) has been deprecated; use for (x <- ... ) instead - for (val s <- args) { - ^ -viewtest.scala:110: warning: for (val x <- ... ) has been deprecated; use for (x <- ... ) instead - for (val s <- args) { - ^ viewtest.scala:43: error: type mismatch; found : List[a(in method compareTo)] required: List[a(in method view3)] @@ -18,5 +9,4 @@ viewtest.scala:104: error: ambiguous implicit values: match expected type (test.Str) => test.Ordered[test.Str] t = t insert Str(s) ^ -three warnings found two errors found diff --git a/test/files/neg/viewtest.scala b/test/files/neg/viewtest.scala index 4c603b61bc..778e672d91 100644 --- a/test/files/neg/viewtest.scala +++ b/test/files/neg/viewtest.scala @@ -93,21 +93,21 @@ object Test { def main(args: Array[String]) = { { var t: Tree[String] = Empty - for (val s <- args) { + for (s <- args) { t = t insert s } Console.println(t.elements) } { var t: Tree[Str] = Empty - for (val s <- args) { + for (s <- args) { t = t insert Str(s) } Console.println(t.elements) } { var t: Tree[List[char]] = Empty - for (val s <- args) { + for (s <- args) { t = t insert toCharList(s) } Console.println(t.elements) diff --git a/test/files/pos/bounds.scala b/test/files/pos/bounds.scala index 5bc5cf89dc..cfea4626c3 100644 --- a/test/files/pos/bounds.scala +++ b/test/files/pos/bounds.scala @@ -7,5 +7,5 @@ class ListMap[A, +B] extends Map[A, B] {} object ListMap { def empty[X, Y] = new ListMap[X, Y] - def apply[A1, B2](elems: Pair[A1, B2]*): Map[A1, B2] = empty[A1,B2].++(elems.elements) + def apply[A1, B2](elems: Pair[A1, B2]*): Map[A1, B2] = empty[A1,B2].++(elems.iterator) } diff --git a/test/files/pos/bug1090.scala b/test/files/pos/bug1090.scala index 69f757fe34..044e327e89 100644 --- a/test/files/pos/bug1090.scala +++ b/test/files/pos/bug1090.scala @@ -1,7 +1,7 @@ object Test { trait Manager { type Node; - def elements : Iterator[Node] + def iterator : Iterator[Node] } trait Core { type Node; @@ -9,7 +9,7 @@ object Test { trait Manager extends Test.Manager { type Node = Core.this.Node } - def f(manager : Manager) = manager.elements.foreach{ + def f(manager : Manager) = manager.iterator.foreach{ case node : NodeImpl => } } diff --git a/test/files/pos/bug247.scala b/test/files/pos/bug247.scala index e2655c6ab3..e976404e61 100644 --- a/test/files/pos/bug247.scala +++ b/test/files/pos/bug247.scala @@ -21,6 +21,6 @@ class TreeMap[KEY,VALUE](_factory:TreeMapFactory[KEY]) extends Tree[KEY,Pair[KEY 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; + def iterator:Iterator[Pair[KEY,VALUE]] = null; override def size = super[Tree].size } diff --git a/test/files/pos/bug927.scala b/test/files/pos/bug927.scala index 5887aba255..7d4c59d94c 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).elements) + val str: Stream[Int] = Stream.fromIterator(List(1,2,3).iterator) assert(sum(str) == 6) } diff --git a/test/files/pos/cyclics.scala b/test/files/pos/cyclics.scala index a49f4faaca..395e88815a 100644 --- a/test/files/pos/cyclics.scala +++ b/test/files/pos/cyclics.scala @@ -12,11 +12,11 @@ trait IterableTemplate { type Constr <: IterableTemplate type ConstrOf[A] = Constr { type Elem = A } - def elements: Iterator[Elem] + def iterator: Iterator[Elem] def map [B] (f: Elem => B): ConstrOf[B] - def foreach(f: Elem => Unit) = elements.foreach(f) + def foreach(f: Elem => Unit) = iterator.foreach(f) } diff --git a/test/files/pos/tcpoly_seq.scala b/test/files/pos/tcpoly_seq.scala index f776ce3fe4..48b3e1ce52 100644 --- a/test/files/pos/tcpoly_seq.scala +++ b/test/files/pos/tcpoly_seq.scala @@ -16,21 +16,21 @@ trait HOSeq { // is an invariant position -- should probably rule that out? trait Iterable[+m[+x], +t] { //def unit[a](orig: a): m[a] - def elements: Iterator[t] + def iterator: Iterator[t] // construct an empty accumulator that will produce the same structure as this iterable, with elements of type t def accumulator[t]: Accumulator[m, t] def filter(p: t => Boolean): m[t] = { val buf = accumulator[t] - val elems = elements + val elems = iterator while (elems.hasNext) { val x = elems.next; if (p(x)) buf += x } buf.result } def map[s](f: t => s): m[s] = { val buf = accumulator[s] - val elems = elements + val elems = iterator while (elems.hasNext) buf += f(elems.next) buf.result } @@ -42,9 +42,9 @@ trait HOSeq { def flatMap[resColl[+x] <: Iterable[resColl, x], s](f: t => resColl[s])(implicit buf: Accumulator[resColl, s]): resColl[s] = { // TODO: would a viewbound for resColl[x] be better? // -- 2nd-order type params are not yet in scope in view bound - val elems = elements + val elems = iterator while (elems.hasNext) { - val elemss: Iterator[s] = f(elems.next).elements + val elemss: Iterator[s] = f(elems.next).iterator while (elemss.hasNext) buf += elemss.next } buf.result @@ -108,7 +108,7 @@ trait HOSeq { def head: t def tail: List[t] def isEmpty: Boolean - def elements: Iterator[t] = new Iterator[t] { + def iterator: Iterator[t] = new Iterator[t] { var these = List.this def hasNext: Boolean = !these.isEmpty def next: t = diff --git a/test/files/pos/tcpoly_seq_typealias.scala b/test/files/pos/tcpoly_seq_typealias.scala index 7a9312a60a..fb48126ce6 100644 --- a/test/files/pos/tcpoly_seq_typealias.scala +++ b/test/files/pos/tcpoly_seq_typealias.scala @@ -18,21 +18,21 @@ trait HOSeq { type m[+x] //def unit[a](orig: a): m[a] - def elements: Iterator[t] + def iterator: Iterator[t] // construct an empty accumulator that will produce the same structure as this iterable, with elements of type t def accumulator[t]: Accumulator[m, t] def filter(p: t => Boolean): m[t] = { val buf = accumulator[t] - val elems = elements + val elems = iterator while (elems.hasNext) { val x = elems.next; if (p(x)) buf += x } buf.result } def map[s](f: t => s): m[s] = { val buf = accumulator[s] - val elems = elements + val elems = iterator while (elems.hasNext) buf += f(elems.next) buf.result } @@ -44,9 +44,9 @@ trait HOSeq { def flatMap[resColl[+x] <: Iterable[x], s](f: t => resColl[s])(implicit buf: Accumulator[resColl, s]): resColl[s] = { // TODO: would a viewbound for resColl[x] be better? // -- 2nd-order type params are not yet in scope in view bound - val elems = elements + val elems = iterator while (elems.hasNext) { - val elemss: Iterator[s] = f(elems.next).elements + val elemss: Iterator[s] = f(elems.next).iterator while (elemss.hasNext) buf += elemss.next } buf.result @@ -112,7 +112,7 @@ trait HOSeq { def head: t def tail: List[t] def isEmpty: Boolean - def elements: Iterator[t] = new Iterator[t] { + def iterator: Iterator[t] = new Iterator[t] { var these = List.this def hasNext: Boolean = !these.isEmpty def next: t = diff --git a/test/files/run/bitsets.scala b/test/files/run/bitsets.scala index abe3d18501..e536e48427 100644 --- a/test/files/run/bitsets.scala +++ b/test/files/run/bitsets.scala @@ -26,9 +26,9 @@ object TestMutable { 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("xs0 = " + ms0.iterator.toList) + Console.println("xs1 = " + ms1.iterator.toList) + Console.println("xs2 = " + ms2.iterator.toList) Console.println("ma0 = " + ms0.toList) Console.println("ma1 = " + ms1.toList) @@ -58,10 +58,10 @@ object TestImmutable { 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("ys0 = " + is0.iterator.toList) + Console.println("ys1 = " + is1.iterator.toList) + Console.println("ys2 = " + is2.iterator.toList) + Console.println("ys3 = " + is3.iterator.toList) Console.println("ia0 = " + is0.toList) Console.println("ia1 = " + is1.toList) diff --git a/test/files/run/bug594.scala b/test/files/run/bug594.scala index b120f47338..0c3be3d5de 100644 --- a/test/files/run/bug594.scala +++ b/test/files/run/bug594.scala @@ -1,7 +1,7 @@ object Test { def main(args: Array[String]): Unit = { val array = Array("one", "two", "three") - val firstTwo: Array[String] = array.subArray(0,2) + val firstTwo: Array[String] = array.slice(0,2) for(val x <- firstTwo) Console.println(x) } diff --git a/test/files/run/colltest.scala b/test/files/run/colltest.scala index 5809812838..b6577006f4 100644 --- a/test/files/run/colltest.scala +++ b/test/files/run/colltest.scala @@ -25,7 +25,7 @@ class TestSet(s0: Set[Int], s1: Set[Int]) { case 7 => "size" } def checkSubSet(pre: String, s0: Set[Int], s1: Set[Int]) { - for (e <- s0.elements) + for (e <- s0.iterator) if (!(s1 contains e)) { assert(false, pre+" element: "+e+"\n S0 = "+s0+"\n S1 = "+s1) } diff --git a/test/files/run/colltest1.scala b/test/files/run/colltest1.scala index f28221e205..9401c63705 100755 --- a/test/files/run/colltest1.scala +++ b/test/files/run/colltest1.scala @@ -30,7 +30,7 @@ object Test extends Application { val (o, e) = ten.partition(_ % 2 == 0) assert(o.size == e.size) val gs = ten groupBy (x => x / 4) - val vs1 = (for (k <- gs.keys; v <- gs(k).toIterable.elements) yield v).toList + val vs1 = (for (k <- gs.keysIterator; v <- gs(k).toIterable.iterator) yield v).toList val vs2 = Traversable.traversableTraversableWrapper[List[Traversable[Int]], Int](gs.values.toList).flatten // val vs2 = gs.values.toList flatMap (xs => xs) assert(ten.head == 1) @@ -67,7 +67,7 @@ object Test extends Application { def orderedIterableTest(empty: Iterable[Int]) { orderedTraversableTest(empty) val six = empty ++ List(1, 2, 3, 4, 5, 6) - assert(six.elements.toStream == six) + assert(six.iterator.toStream == six) assert(six.takeRight(4) == List(3, 4, 5, 6), six.takeRight(4)) assert(six.dropRight(3) == List(1, 2, 3)) assert(six sameElements (1 to 6)) @@ -107,7 +107,7 @@ object Test extends Application { assert(ten.reverse startsWith List(10, 9, 8), ten.reverse.take(10).toList) assert(ten.reverse.length == 10) assert(ten.reverse.reverse == ten) - assert(ten.reversedElements.toList.reverse == ten, ten.reversedElements.toList) + assert(ten.reverseIterator.toList.reverse == ten, ten.reverseIterator.toList) assert(ten.startsWith(List(1))) assert(ten.startsWith(List(3, 4), 2)) assert(ten.endsWith(List(9, 10))) @@ -174,10 +174,10 @@ object Test extends Application { assert(m.keys forall (k => (m apply k) == k)) assert(m.keys forall (m contains)) assert(m.getOrElse("7", "@") == "@") - assert(m.keys.length == 26) + assert(m.keys.size == 26) assert(m.size == 26) - assert(m.keySet == Set() ++ m.keys) - assert(m.keys.toList == m.values.toList) + assert(m.keys == Set() ++ m.keys) + assert(m.keysIterator.toList == m.keys.toList) val m1 = empty ++ m val mm = m -- m.keySet.toList assert(mm.isEmpty, mm) diff --git a/test/files/run/docgenerator.scala b/test/files/run/docgenerator.scala index ccb5b50ed6..e3f724a603 100644 --- a/test/files/run/docgenerator.scala +++ b/test/files/run/docgenerator.scala @@ -114,7 +114,7 @@ object Foo2 { def process(args: Array[String]) { val docSettings = new scala.tools.nsc.doc.Settings(error) reporter = new ConsoleReporter(docSettings) - val command = new CompilerCommand(List.fromArray(args), docSettings, error, false) + val command = new CompilerCommand(args.toList, docSettings, error, false) try { object compiler extends Global(command.settings, reporter) { override protected def computeInternalPhases() : Unit = { diff --git a/test/files/run/iterables.scala b/test/files/run/iterables.scala index 5fb587a323..5334b456ff 100644 --- a/test/files/run/iterables.scala +++ b/test/files/run/iterables.scala @@ -1,7 +1,7 @@ object Test extends Application { class Test(n: Int) extends Iterable[Int] { private var i = 0 - def elements = new Iterator[Int] { + def iterator = new Iterator[Int] { def hasNext = i < n def next = if (hasNext) { val v = i; i += 1; v } diff --git a/test/files/run/iterators.scala b/test/files/run/iterators.scala index db6d3632e9..11c41662d7 100644 --- a/test/files/run/iterators.scala +++ b/test/files/run/iterators.scala @@ -85,7 +85,7 @@ object Test { } def check_collect: String = - List(1, 2, 3, 4, 5).elements.collect.mkString("x") + List(1, 2, 3, 4, 5).iterator.collect.mkString("x") def check_indexOf: String = { val i = List(1, 2, 3, 4, 5).indexOf(4) diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala index 3840b44b86..a16f300414 100644 --- a/test/files/run/patmatnew.scala +++ b/test/files/run/patmatnew.scala @@ -315,7 +315,7 @@ object Test extends TestConsoleMain { case Stream.cons(hd, tl) => hd + sum(tl) } - val str: Stream[int] = Stream.fromIterator(List(1,2,3).elements) + val str: Stream[int] = Stream.fromIterator(List(1,2,3).iterator) def runTest() = assertEquals(sum(str), 6) } diff --git a/test/files/run/range.scala b/test/files/run/range.scala index 18f3ace645..7d30dc30c2 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, buffer.toList+"/"+range.elements.toList) + assert(buffer.toList == range.iterator.toList, buffer.toList+"/"+range.iterator.toList) } rangeForeach(1 to 10); diff --git a/test/files/run/regularpatmat.scala.disabled b/test/files/run/regularpatmat.scala.disabled index d8e244d03b..4d60029b6e 100644 --- a/test/files/run/regularpatmat.scala.disabled +++ b/test/files/run/regularpatmat.scala.disabled @@ -709,7 +709,7 @@ object testBugSequenceApply { case class ThreeBars extends Seq[Int] { override def length = 3; - def elements = x.elements; + def iterator = x.iterator; def apply(i:Int) = x.apply(i); } diff --git a/test/files/run/richs.scala b/test/files/run/richs.scala index 674ca8fe10..5ee573673d 100644 --- a/test/files/run/richs.scala +++ b/test/files/run/richs.scala @@ -26,7 +26,7 @@ object RichCharTest1 extends RichTest { } // object RichCharTest2 extends RichTest { // case class C(s: String) { -// private val it = s.elements +// private val it = s.iterator // private var c: Char = _ // def ch(): Char = c // def nextch(): Unit = { c = if (it.hasNext) it.next else ';' } diff --git a/test/files/run/unapply.scala b/test/files/run/unapply.scala index f540b2a2a9..fa50790a18 100644 --- a/test/files/run/unapply.scala +++ b/test/files/run/unapply.scala @@ -111,7 +111,7 @@ object StreamFoo extends TestCase("unapply for Streams") with Assert { case Stream.cons(hd, tl) => hd + sum(tl) } override def runTest { - val str: Stream[int] = Stream.fromIterator(List(1,2,3).elements) + val str: Stream[int] = Stream.fromIterator(List(1,2,3).iterator) assertEquals(sum(str), 6) } } diff --git a/test/files/run/withIndex.scala b/test/files/run/withIndex.scala index f0c3e7a468..3b9c9e84e5 100644 --- a/test/files/run/withIndex.scala +++ b/test/files/run/withIndex.scala @@ -2,8 +2,8 @@ object Test { def main(args: Array[String]) = { val ary: Array[String] = Array("a", "b", "c") val lst: List[String] = List("a", "b", "c") - val itr: Iterator[String] = lst.elements - val str: Stream[String] = Stream.fromIterator(lst.elements) + val itr: Iterator[String] = lst.iterator + val str: Stream[String] = Stream.fromIterator(lst.iterator) Console.println(ary.zipWithIndex.toList) Console.println(lst.zipWithIndex.toList) @@ -18,7 +18,7 @@ object Test { val emptyArray = new Array[String](0) val emptyList: List[String] = Nil - val emptyIterator = emptyList.elements + val emptyIterator = emptyList.iterator val emptyStream: Stream[String] = Stream.empty Console.println(emptyArray.zipWithIndex.toList) diff --git a/test/pending/jvm/serialization.scala b/test/pending/jvm/serialization.scala index 589e82c4c1..2c46ee0b7b 100644 --- a/test/pending/jvm/serialization.scala +++ b/test/pending/jvm/serialization.scala @@ -39,7 +39,7 @@ object Serialize { object Test1_scala { private def arrayToString[A](arr: Array[A]): String = - List.fromArray(arr).mkString("Array[",",","]") + arr.mkString("Array[",",","]") private def arrayEquals[A, B](a1: Array[A], a2: Array[B]) = (a1.length == a2.length) && @@ -225,7 +225,7 @@ object Test4_xml { <th>Last Name</th> <th>First Name</th> </tr> - { for (val p <- people) yield + { for (p <- people) yield <tr> <td> { p.name } </td> <td> { p.age.toString() } </td> diff --git a/test/pending/pos/bug586.scala b/test/pending/pos/bug586.scala index ca0a508baa..b736e6ab43 100644 --- a/test/pending/pos/bug586.scala +++ b/test/pending/pos/bug586.scala @@ -11,7 +11,7 @@ with imm.Set[A] def +(elem: A) = new HashTreeSet(map + elem -> ()) def -(elem: A) = new HashTreeSet(map - elem) def contains(elem: A) = map.isDefinedAt(elem) - def elements = map.elements.map(._1) + def iterator = map.iterator.map(._1) def empty:imm.Set[A] = new HashTreeSet[A]() } diff --git a/test/pending/run/t1044.scala b/test/pending/run/t1044.scala index 136cc51af2..e10002e601 100644 --- a/test/pending/run/t1044.scala +++ b/test/pending/run/t1044.scala @@ -1,4 +1,4 @@ object Main extends Application{ val ducks = Array[AnyRef]("Huey", "Dewey", "Louie") - ducks.elements/*.asInstanceOf[Iterator[String]]*/ + ducks.iterator/*.asInstanceOf[Iterator[String]]*/ } |