diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/bitsets.scala | 14 | ||||
-rw-r--r-- | test/files/run/bug594.scala | 2 | ||||
-rw-r--r-- | test/files/run/colltest.scala | 2 | ||||
-rwxr-xr-x | test/files/run/colltest1.scala | 12 | ||||
-rw-r--r-- | test/files/run/docgenerator.scala | 2 | ||||
-rw-r--r-- | test/files/run/iterables.scala | 2 | ||||
-rw-r--r-- | test/files/run/iterators.scala | 2 | ||||
-rw-r--r-- | test/files/run/patmatnew.scala | 2 | ||||
-rw-r--r-- | test/files/run/range.scala | 2 | ||||
-rw-r--r-- | test/files/run/regularpatmat.scala.disabled | 2 | ||||
-rw-r--r-- | test/files/run/richs.scala | 2 | ||||
-rw-r--r-- | test/files/run/unapply.scala | 2 | ||||
-rw-r--r-- | test/files/run/withIndex.scala | 6 |
13 files changed, 26 insertions, 26 deletions
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) |