From b6778be91900b8161e705dc2598ef7af86842b0b Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Wed, 2 Nov 2011 14:34:35 +0000 Subject: Begone t1737... --- test/files/run/Course-2002-02.scala | 8 +- test/files/run/Course-2002-05.scala | 2 +- test/files/run/Course-2002-08.scala | 2 +- test/files/run/OrderingTest.scala | 8 +- test/files/run/ReplacementMatching.scala | 10 +- test/files/run/ReverseSeqView.scala | 4 +- test/files/run/UnrolledBuffer.scala | 44 +-- test/files/run/absoverride.scala | 10 +- test/files/run/arrayclone.scala | 24 +- test/files/run/arraycopy.scala | 2 +- test/files/run/arrayview.scala | 2 +- test/files/run/bigDecimalCache.scala | 4 +- test/files/run/bigDecimalTest.scala | 2 +- test/files/run/boolexprs.scala | 2 +- test/files/run/bugs.scala | 2 +- test/files/run/caseClassEquality.scala | 12 +- test/files/run/castsingleton.scala | 2 +- test/files/run/checked.scala | 6 +- test/files/run/classof.scala | 4 +- test/files/run/code.scala | 2 +- test/files/run/collections-toSelf.scala | 2 +- test/files/run/collections.scala | 4 +- test/files/run/colltest1.scala | 8 +- test/files/run/comparable-comparator.scala | 8 +- test/files/run/concat-two-strings.scala | 2 +- test/files/run/constrained-types.check | 4 +- test/files/run/constrained-types.scala | 4 +- test/files/run/ctor-order.scala | 2 +- test/files/run/distinct.scala | 2 +- test/files/run/elidable-noflags.scala | 2 +- test/files/run/elidable.scala | 2 +- test/files/run/emptypf.scala | 4 +- test/files/run/equality.scala | 10 +- test/files/run/exceptions-2.scala | 42 +-- test/files/run/existentials.scala | 4 +- test/files/run/finally.scala | 12 +- test/files/run/flat-flat-flat.scala | 2 +- test/files/run/forvaleq.scala | 30 +- test/files/run/gadts.scala | 4 +- test/files/run/getClassTest.scala | 10 +- test/files/run/global-showdef.scala | 8 +- test/files/run/groupby.scala | 6 +- test/files/run/hashCodeBoxesRunTime.scala | 12 +- test/files/run/hashhash.scala | 2 +- test/files/run/indexedSeq.scala | 4 +- test/files/run/infix.scala | 2 +- test/files/run/inliner-infer.scala | 6 +- test/files/run/inner-obj-auto.scala | 440 +++++++++++++------------- test/files/run/io-position.scala | 8 +- test/files/run/iq.scala | 24 +- test/files/run/is-valid-num.scala | 2 +- test/files/run/issue192.scala | 32 +- test/files/run/iterator3444.scala | 12 +- test/files/run/iterators.scala | 6 +- test/files/run/java-erasure.scala | 2 +- test/files/run/json.scala | 16 +- test/files/run/kmpSliceSearch.scala | 8 +- test/files/run/lazy-exprs.scala | 16 +- test/files/run/lazy-locals.scala | 10 +- test/files/run/lazy-override-run.scala | 4 +- test/files/run/lazy-traits.scala | 74 ++--- test/files/run/lift-and-unlift.scala | 10 +- test/files/run/lists-run.scala | 8 +- test/files/run/manifests.scala | 46 +-- test/files/run/mapConserve.scala | 6 +- test/files/run/mapValues.scala | 2 +- test/files/run/map_java_conversions.scala | 24 +- test/files/run/matchbytes.scala | 2 +- test/files/run/matchintasany.scala | 2 +- test/files/run/matchnull.scala | 2 +- test/files/run/misc.scala | 2 +- test/files/run/missingparams.scala | 4 +- test/files/run/mock.scala | 6 +- test/files/run/nodebuffer-array.scala | 4 +- test/files/run/null-and-intersect.scala | 6 +- test/files/run/null-hash.scala | 2 +- test/files/run/number-parsing.scala | 4 +- test/files/run/numbereq.scala | 14 +- test/files/run/origins.scala | 2 +- test/files/run/packrat1.scala | 8 +- test/files/run/packrat2.scala | 14 +- test/files/run/packrat3.scala | 12 +- test/files/run/parmap-ops.scala | 12 +- test/files/run/patch-boundary.scala | 4 +- test/files/run/patmat-exprs.scala | 6 +- test/files/run/patmat-seqs.scala | 10 +- test/files/run/patmatnew.scala | 4 +- test/files/run/pc-conversions.scala | 34 +- test/files/run/pf-catch.scala | 6 +- test/files/run/primitive-sigs-2.scala | 2 +- test/files/run/priorityQueue.scala | 66 ++-- test/files/run/private-inline.scala | 16 +- test/files/run/programmatic-main.scala | 2 +- test/files/run/proxy.scala | 6 +- test/files/run/range.scala | 24 +- test/files/run/records.scala | 6 +- test/files/run/repl-backticks.scala | 10 +- test/files/run/repl-suppressed-warnings.scala | 2 +- test/files/run/run-bug4840.scala | 8 +- test/files/run/runtime-richChar.scala | 10 +- test/files/run/scan.scala | 8 +- test/files/run/seqlike-kmp.scala | 6 +- test/files/run/sequenceComparisons.scala | 40 +-- test/files/run/serialize-stream.scala | 4 +- test/files/run/slice-strings.scala | 6 +- test/files/run/streamWithFilter.scala | 2 +- test/files/run/streams.scala | 2 +- test/files/run/stringbuilder.scala | 14 +- test/files/run/structural.scala | 52 +-- test/files/run/sysprops.scala | 10 +- test/files/run/t0017.scala | 2 +- test/files/run/t0325.scala | 8 +- test/files/run/t0421.scala | 10 +- test/files/run/t0508.scala | 2 +- test/files/run/t0631.scala | 2 +- test/files/run/t0677.scala | 2 +- test/files/run/t0807.scala | 2 +- test/files/run/t0883.scala | 12 +- test/files/run/t1005.scala | 2 +- test/files/run/t1141.scala | 2 +- test/files/run/t1167.scala | 6 +- test/files/run/t1220.scala | 2 +- test/files/run/t1300.scala | 4 +- test/files/run/t1309.scala | 2 +- test/files/run/t1323.scala | 4 +- test/files/run/t1333.scala | 4 +- test/files/run/t1423.scala | 2 +- test/files/run/t1427.scala | 2 +- test/files/run/t1500.scala | 24 +- test/files/run/t1501.scala | 20 +- test/files/run/t1537.scala | 6 +- test/files/run/t1591.scala | 6 +- test/files/run/t1718.scala | 4 +- test/files/run/t1766.scala | 12 +- test/files/run/t1773.scala | 2 +- test/files/run/t1829.scala | 2 +- test/files/run/t2029.scala | 4 +- test/files/run/t2074_2.scala | 2 +- test/files/run/t2087-and-2400.scala | 6 +- test/files/run/t2124.scala | 2 +- test/files/run/t2125.scala | 4 +- test/files/run/t2276.scala | 2 +- test/files/run/t2308a.scala | 4 +- test/files/run/t2354.scala | 2 +- test/files/run/t2417.scala | 18 +- test/files/run/t2512.scala | 4 +- test/files/run/t2514.scala | 4 +- test/files/run/t2526.scala | 16 +- test/files/run/t2552.scala | 14 +- test/files/run/t2636.scala | 12 +- test/files/run/t266.scala | 4 +- test/files/run/t2721.scala | 4 +- test/files/run/t2755.scala | 6 +- test/files/run/t2800.scala | 8 +- test/files/run/t2849.scala | 6 +- test/files/run/t2867.scala | 6 +- test/files/run/t2958.scala | 4 +- test/files/run/t3026.scala | 2 +- test/files/run/t3038.scala | 14 +- test/files/run/t3038c/A_1.scala | 4 +- test/files/run/t3038d.scala | 10 +- test/files/run/t3050.scala | 4 +- test/files/run/t3112.scala | 2 +- test/files/run/t3150.scala | 2 +- test/files/run/t3158.scala | 2 +- test/files/run/t3175.scala | 26 +- test/files/run/t3232.scala | 6 +- test/files/run/t3269.scala | 2 +- test/files/run/t3273.scala | 2 +- test/files/run/t3361.scala | 2 +- test/files/run/t3395.scala | 6 +- test/files/run/t3397.scala | 2 +- test/files/run/t3493.scala | 4 +- test/files/run/t3496.scala | 4 +- test/files/run/t3502.scala | 6 +- test/files/run/t3509.scala | 4 +- test/files/run/t3511.scala | 18 +- test/files/run/t3516.scala | 2 +- test/files/run/t3518.scala | 2 +- test/files/run/t3530.scala | 6 +- test/files/run/t3540.scala | 2 +- test/files/run/t3563.scala | 6 +- test/files/run/t3580.scala | 6 +- test/files/run/t3603.scala | 8 +- test/files/run/t3613.scala | 6 +- test/files/run/t3619.scala | 2 +- test/files/run/t363.scala | 2 +- test/files/run/t3647.scala | 4 +- test/files/run/t3714.scala | 2 +- test/files/run/t3719.scala | 4 +- test/files/run/t3822.scala | 8 +- test/files/run/t3829.scala | 10 +- test/files/run/t3855.scala | 2 +- test/files/run/t3877.scala | 16 +- test/files/run/t3887.scala | 2 +- test/files/run/t3888.scala | 4 +- test/files/run/t3897/J_2.java | 4 +- test/files/run/t3897/a_2.scala | 6 +- test/files/run/t3932.scala | 4 +- test/files/run/t3964.scala | 6 +- test/files/run/t3970.scala | 4 +- test/files/run/t3980.scala | 2 +- test/files/run/t3984.scala | 2 +- test/files/run/t4013.scala | 4 +- test/files/run/t4013b.scala | 2 +- test/files/run/t4024.scala | 4 +- test/files/run/t4054.scala | 2 +- test/files/run/t4062.scala | 2 +- test/files/run/t4072.scala | 4 +- test/files/run/t408.scala | 2 +- test/files/run/t4110.scala | 2 +- test/files/run/t4119/J.java | 2 +- test/files/run/t4119/S.scala | 2 +- test/files/run/t4122.scala | 2 +- test/files/run/t4148.scala | 2 +- test/files/run/t4238/J_1.java | 4 +- test/files/run/t4288.scala | 2 +- test/files/run/t4294.scala | 2 +- test/files/run/t4317/S_3.scala | 2 +- test/files/run/t4387.scala | 4 +- test/files/run/t4396.scala | 2 +- test/files/run/t4426.scala | 6 +- test/files/run/t4461.scala | 2 +- test/files/run/t4532.check | 6 +- test/files/run/t4532.scala | 10 +- test/files/run/t4535.scala | 10 +- test/files/run/t4560.scala | 2 +- test/files/run/t4570.scala | 4 +- test/files/run/t4608.scala | 4 +- test/files/run/t4617.scala | 2 +- test/files/run/t4656.scala | 2 +- test/files/run/t4671.check | 4 +- test/files/run/t4671.scala | 2 +- test/files/run/t4680.scala | 4 +- test/files/run/t4697.scala | 2 +- test/files/run/t4752.scala | 4 +- test/files/run/t4753.scala | 2 +- test/files/run/t4761.scala | 2 +- test/files/run/t4894.scala | 8 +- test/files/run/t4895.scala | 6 +- test/files/run/t576.scala | 6 +- test/files/run/t603.scala | 2 +- test/files/run/t744.scala | 2 +- test/files/run/t874.scala | 2 +- test/files/run/t920.scala | 2 +- test/files/run/tailcalls.scala | 16 +- test/files/run/takeAndDrop.scala | 4 +- test/files/run/tcpoly_monads.scala | 8 +- test/files/run/tcpoly_parseridioms.scala | 44 +-- test/files/run/transform.scala | 2 +- test/files/run/transpose.scala | 4 +- test/files/run/treePrint.scala | 8 +- test/files/run/triple-quoted-expr.scala | 8 +- test/files/run/try-2.scala | 12 +- test/files/run/try.scala | 6 +- test/files/run/tuple-match.scala | 4 +- test/files/run/tuple-zipped.scala | 16 +- test/files/run/typealias_overriding.scala | 8 +- test/files/run/unapply.scala | 6 +- test/files/run/unittest_collection.scala | 6 +- test/files/run/unittest_iterator.scala | 12 +- test/files/run/vector1.scala | 24 +- test/files/run/view-headoption.scala | 4 +- test/files/run/view-iterator-stream.scala | 8 +- test/files/run/viewtest.scala | 4 +- test/files/run/virtpatmat_apply.scala | 2 +- test/files/run/virtpatmat_casting.scala | 6 +- test/files/run/virtpatmat_literal.scala | 24 +- test/files/run/virtpatmat_partial.scala | 2 +- test/files/run/virtpatmat_typed.scala | 8 +- test/files/run/virtpatmat_unapply.scala | 14 +- test/files/run/xml-loop-bug.scala | 2 +- 272 files changed, 1241 insertions(+), 1241 deletions(-) (limited to 'test/files/run') diff --git a/test/files/run/Course-2002-02.scala b/test/files/run/Course-2002-02.scala index b8650108ed..56d7298aaf 100644 --- a/test/files/run/Course-2002-02.scala +++ b/test/files/run/Course-2002-02.scala @@ -100,7 +100,7 @@ object M4 { def sumInts = sum(x => x) def sumCubes = sum(x => x * x * x) - def sumReciprocals = sum(1.0/_) + def sumReciprocals = sum(1.0/_) def sumPi = { n: Int => 4 + sum(x => 4.0/(4*x+1) - 4.0/(4*x-1))(1, n) } Console.println(sumInts(1,4)) @@ -194,7 +194,7 @@ object M8 { //############################################################################ object M9 { - def accumulate[t](combiner: (t, t) => t, nullValue: t, f: Int => t, + def accumulate[t](combiner: (t, t) => t, nullValue: t, f: Int => t, next: Int => Int)(a: Int, b: Int): t = if (a > b) nullValue else combiner(f(a), accumulate(combiner, nullValue, f, next)(next(a), b)) @@ -328,9 +328,9 @@ object MD { iter(a, zero) } - def plus (x:Double,y:Double) = x+y; + def plus (x:Double,y:Double) = x+y; val sum: (Int => Double) => (Int, Int) => Double = reduce(plus , 0); - def times(x:Double,y:Double) = x*y; + def times(x:Double,y:Double) = x*y; val product: (Int => Double) => (Int, Int) => Double = reduce(times, 1); def factorial(n: Int) = product(x => x)(1 , n) diff --git a/test/files/run/Course-2002-05.scala b/test/files/run/Course-2002-05.scala index e6764b92c8..9457fae147 100644 --- a/test/files/run/Course-2002-05.scala +++ b/test/files/run/Course-2002-05.scala @@ -129,7 +129,7 @@ object M3 { else { def isSafe(column: Int, placement: Placement): Boolean = placement forall { - pos => (pos._2 != column && + pos => (pos._2 != column && abs(pos._2 - column) != row - pos._1) } diff --git a/test/files/run/Course-2002-08.scala b/test/files/run/Course-2002-08.scala index 2423bbc36a..85a83e0146 100644 --- a/test/files/run/Course-2002-08.scala +++ b/test/files/run/Course-2002-08.scala @@ -520,7 +520,7 @@ abstract class CircuitSimulator() extends BasicCircuitSimulator() { val w1 = new Wire(); val w2 = new Wire(); val w3 = new Wire(); - + andGate(in, ctrl(1), w3); andGate(in, ctrl(1), w2); andGate(in, ctrlN(1), w1); diff --git a/test/files/run/OrderingTest.scala b/test/files/run/OrderingTest.scala index 8af18aaba5..53448fbbce 100644 --- a/test/files/run/OrderingTest.scala +++ b/test/files/run/OrderingTest.scala @@ -6,7 +6,7 @@ object Test extends App { assert((cmp == 0) == (cmp2 == 0)) assert((cmp > 0) == (cmp2 < 0)) assert((cmp < 0) == (cmp2 > 0)) - } + } def testAll[T](t1 : T, t2 : T)(implicit ord : Ordering[T]) = { assert(ord.compare(t1, t2) < 0) @@ -16,8 +16,8 @@ object Test extends App { } assert(Ordering[String].compare("australopithecus", "brontausaurus") < 0) - // assert(Ordering[Unit].compare((), ()) == 0) - + // assert(Ordering[Unit].compare((), ()) == 0) + testAll("bar", "foo"); testAll[Byte](0, 1); testAll(false, true) @@ -28,7 +28,7 @@ object Test extends App { testAll[Iterable[Int]](List(1, 2), List(2)); testAll((1, "bar"), (1, "foo")) testAll((1, "foo"), (2, "bar")) - + // sortBy val words = "The quick brown fox jumped over the lazy dog".split(' ') val result = words.sortBy(x => (x.length, x.head)) diff --git a/test/files/run/ReplacementMatching.scala b/test/files/run/ReplacementMatching.scala index 05040d98a3..faa46419dc 100644 --- a/test/files/run/ReplacementMatching.scala +++ b/test/files/run/ReplacementMatching.scala @@ -7,12 +7,12 @@ import util.matching._ object Test { - + def main(args: Array[String]) { replacementMatching groupsMatching } - + def replacementMatching { val regex = """\$\{(.+?)\}""".r val replaced = regex.replaceAllIn("Replacing: ${main}. And another method: ${foo}.", @@ -21,7 +21,7 @@ object Test { identifier }) assert(replaced == "Replacing: main. And another method: foo.") - + val regex3 = """\$\{(.+?)\}""".r val replaced3 = regex3.replaceSomeIn("Replacing: ${main}. And another: ${foo}.", (m: util.matching.Regex.Match) => { val id = m.group(1) @@ -29,7 +29,7 @@ object Test { }) assert(replaced3 == "Replacing: main. And another: ${foo}.") } - + def groupsMatching { val Date = """(\d+)/(\d+)/(\d+)""".r for (Regex.Groups(a, b, c) <- Date findFirstMatchIn "1/1/2001 marks the start of the millenium. 31/12/2000 doesn't.") { @@ -43,5 +43,5 @@ object Test { assert(c == "2001" || c == "2000") } } - + } diff --git a/test/files/run/ReverseSeqView.scala b/test/files/run/ReverseSeqView.scala index 2004791bff..517f1cc24c 100644 --- a/test/files/run/ReverseSeqView.scala +++ b/test/files/run/ReverseSeqView.scala @@ -5,14 +5,14 @@ object Test extends App { - + val lstv = List(1, 2, 3).view val lstvr = lstv.reverse assert(lstvr.iterator.toList == List(3, 2, 1)) assert(lstvr.reverse == List(1, 2, 3)) assert(lstvr.reverseIterator.toList == List(1, 2, 3)) assert(lstvr.reverseMap(_ + 1) == List(2, 3, 4)) - + } diff --git a/test/files/run/UnrolledBuffer.scala b/test/files/run/UnrolledBuffer.scala index 62a1f7d083..fe08e812ac 100644 --- a/test/files/run/UnrolledBuffer.scala +++ b/test/files/run/UnrolledBuffer.scala @@ -7,12 +7,12 @@ import collection.mutable.UnrolledBuffer object Test { - + def main(args: Array[String]) { val u1 = new UnrolledBuffer[Int] assert(u1.isEmpty) assert(u1.size == 0) - + u1 += 1 u1 += 2 u1 += 3 @@ -20,11 +20,11 @@ object Test { assert(u1.toList == List(1, 2, 3)) assert(u1.nonEmpty) assert(u1.size == 3) - + u1.clear assert(u1.isEmpty) assert(u1.size == 0) - + u1 += 1 u1 += 2 u1 += 3 @@ -33,56 +33,56 @@ object Test { assert(u1.size == 2) assert(u1 == UnrolledBuffer(1, 3)) assert(u1.toList == List(1, 3)) - + u1 concat UnrolledBuffer(5, 7, 9) assert(u1 == UnrolledBuffer(1, 3, 5, 7, 9)) - + val u2 = u1 map { x => (x - 1) / 2 } assert(u2 == UnrolledBuffer(0, 1, 2, 3, 4)) - + u1.clear u2.clear assert(u1.size == 0) assert(u2.size == 0) - + for (i <- 0 until 500) u1 += i for (i <- 500 until 1000) u2 += i assert(u1.size == 500) assert(u2.size == 500) assert(u1.iterator.toList == (0 until 500).toList) assert((for (elem <- u1) yield elem) sameElements (0 until 500)) - + u1 concat u2 assert(u1.size == 1000) assert(u2.size == 0) assertCorrect(u1) - + u1 concat UnrolledBuffer() assertCorrect(u1) - + val u3 = u1 map { x => x } var i = 0 for (elem <- u1) { assert(elem == u3(i)) i += 1 } - + u1.remove(999) assert(u1.size == 999) assertCorrect(u1) - + u1.remove(500) assert(u1.size == 998) assertCorrect(u1) - + u1.remove(5) assert(u1.size == 997) assertCorrect(u1) - + u1.remove(0) assert(u1.size == 996) assertCorrect(u1) - + u1.insert(0, 0) assert(u1.size == 997) assertCorrect(u1) @@ -90,15 +90,15 @@ object Test { u1.insert(5, 5) assert(u1.size == 998) assertCorrect(u1) - + u1.insert(500, 500) assert(u1.size == 999) assertCorrect(u1) - + u1.insert(999, 999) assert(u1.size == 1000) assertCorrect(u1) - + for (i <- -100 until 0) { i +=: u1 assertCorrect(u1) @@ -106,7 +106,7 @@ object Test { assert(u1.size == 1100) assertCorrect(u1) } - + def assertCorrect(u1: UnrolledBuffer[Int]) { val sz = u1.size val store = new Array[Int](sz) @@ -117,9 +117,9 @@ object Test { for (i <- 0 until sz) assert(u1(i) == (sz - i)) for (i <- 0 until sz) u1(i) = store(i) for (i <- 0 until sz) assert(store(i) == u1(i)) - + assert((u1 map { x => x }) == u1) assert(u1.iterator.toSeq.size == u1.size) } - + } diff --git a/test/files/run/absoverride.scala b/test/files/run/absoverride.scala index a3c03df0d7..8c6de09d2a 100644 --- a/test/files/run/absoverride.scala +++ b/test/files/run/absoverride.scala @@ -26,16 +26,16 @@ trait SyncIterator extends AbsIterator { } } trait LoggedIterator extends AbsIterator { - abstract override def next: T = { - val x = super.next; println("log: " + x); x + abstract override def next: T = { + val x = super.next; println("log: " + x); x } } -class Iter2(s: String) extends StringIterator(s) - with SyncIterator with LoggedIterator; +class Iter2(s: String) extends StringIterator(s) + with SyncIterator with LoggedIterator; object Test { def main(args: Array[String]) { class Iter extends StringIterator(args(0)) with RichIterator with SyncIterator with LoggedIterator val iter = new Iter - iter foreach Console.println + iter foreach Console.println } } diff --git a/test/files/run/arrayclone.scala b/test/files/run/arrayclone.scala index fbca38b42e..c9f7556b47 100644 --- a/test/files/run/arrayclone.scala +++ b/test/files/run/arrayclone.scala @@ -16,7 +16,7 @@ object BooleanArrayClone{ val cloned = it.clone(); assert(cloned.sameElements(it)); cloned(0) = false; - assert(it(0) == true) + assert(it(0) == true) } object ByteArrayClone{ @@ -24,7 +24,7 @@ object ByteArrayClone{ val cloned = it.clone(); assert(cloned.sameElements(it)); cloned(0) = 0; - assert(it(0) == 1) + assert(it(0) == 1) } object ShortArrayClone{ @@ -32,7 +32,7 @@ object ShortArrayClone{ val cloned = it.clone(); assert(cloned.sameElements(it)); cloned(0) = 0; - assert(it(0) == 1) + assert(it(0) == 1) } object CharArrayClone{ @@ -40,7 +40,7 @@ object CharArrayClone{ val cloned = it.clone(); assert(cloned.sameElements(it)); cloned(0) = 0; - assert(it(0) == 1) + assert(it(0) == 1) } object IntArrayClone{ @@ -48,7 +48,7 @@ object IntArrayClone{ val cloned = it.clone(); assert(cloned.sameElements(it)); cloned(0) = 0; - assert(it(0) == 1) + assert(it(0) == 1) } object LongArrayClone{ @@ -56,7 +56,7 @@ object LongArrayClone{ val cloned = it.clone(); assert(cloned.sameElements(it)); cloned(0) = 0; - assert(it(0) == 1) + assert(it(0) == 1) } object FloatArrayClone{ @@ -64,7 +64,7 @@ object FloatArrayClone{ val cloned = it.clone(); assert(cloned.sameElements(it)); cloned(0) = 0; - assert(it(0) == 1) + assert(it(0) == 1) } object DoubleArrayClone{ @@ -72,7 +72,7 @@ object DoubleArrayClone{ val cloned = it.clone(); assert(cloned.sameElements(it)); cloned(0) = 0; - assert(it(0) == 1) + assert(it(0) == 1) } object ObjectArrayClone{ @@ -80,7 +80,7 @@ object ObjectArrayClone{ val cloned = it.clone(); assert(cloned.sameElements(it)); cloned(0) = "0"; - assert(it(0) == "1") + assert(it(0) == "1") } object PolymorphicArrayClone{ @@ -88,14 +88,14 @@ object PolymorphicArrayClone{ val cloned = it.clone(); assert(cloned.sameElements(it)); cloned(0) = zero; - assert(it(0) == one) - } + assert(it(0) == one) + } testIt(Array("one", "two"), "one", "two"); class Mangler[T: Manifest](ts : T*){ // this will always be a BoxedAnyArray even after we've unboxed its contents. - val it = ts.toArray[T]; + val it = ts.toArray[T]; } val mangled = new Mangler[Int](0, 1); diff --git a/test/files/run/arraycopy.scala b/test/files/run/arraycopy.scala index bb06200dc7..82c34c23e7 100644 --- a/test/files/run/arraycopy.scala +++ b/test/files/run/arraycopy.scala @@ -5,7 +5,7 @@ object Test { val a = new Array[Int](10) val b = new Array[Any](10) for (i <- 0 until 10) b(i) = i - + Array.copy(b, 3, a, 3, 7) assert(a.toSeq == List(0, 0, 0, 3, 4, 5, 6, 7, 8, 9)) } diff --git a/test/files/run/arrayview.scala b/test/files/run/arrayview.scala index 97e840f5e9..42ced5e9ac 100644 --- a/test/files/run/arrayview.scala +++ b/test/files/run/arrayview.scala @@ -1,6 +1,6 @@ object Test { def f = (1 to 100).toArray.view - + def main(args: Array[String]): Unit = { val xs = (f filter (_ < 50)).reverse.filter(_ % 2 == 0).map(_ / 2).flatMap(x => Array(1, x)) assert(xs.size == 48) diff --git a/test/files/run/bigDecimalCache.scala b/test/files/run/bigDecimalCache.scala index c0c709a50f..e8ebefee78 100644 --- a/test/files/run/bigDecimalCache.scala +++ b/test/files/run/bigDecimalCache.scala @@ -1,9 +1,9 @@ -object Test { +object Test { def main(args: Array[String]): Unit = { val bd5a = BigDecimal(5) val mc = java.math.MathContext.DECIMAL32 val bd5b = BigDecimal(5,mc) - + assert(bd5b.mc == mc) } } diff --git a/test/files/run/bigDecimalTest.scala b/test/files/run/bigDecimalTest.scala index 480305d7d4..07b524c017 100644 --- a/test/files/run/bigDecimalTest.scala +++ b/test/files/run/bigDecimalTest.scala @@ -28,7 +28,7 @@ object Test { // SI-4547: implicit conversion assert(5 + BigDecimal(3) == BigDecimal(8)) - + // meaningless sanity check List[BigDecimal](a, b, c, d, e, f) map (_.scale) foreach println } diff --git a/test/files/run/boolexprs.scala b/test/files/run/boolexprs.scala index b9b4faea9c..4f1c4b161a 100644 --- a/test/files/run/boolexprs.scala +++ b/test/files/run/boolexprs.scala @@ -10,7 +10,7 @@ class Counter { object Test1 { var flag = false; - def flip: Boolean = { val tmp = flag; flag = !flag; tmp } + def flip: Boolean = { val tmp = flag; flag = !flag; tmp } def run: Int = { val c = new Counter; c.incrThen(flip || flip); diff --git a/test/files/run/bugs.scala b/test/files/run/bugs.scala index bbf2a0fb39..d5905af76c 100644 --- a/test/files/run/bugs.scala +++ b/test/files/run/bugs.scala @@ -304,7 +304,7 @@ object Bug250Test { // Bug 257 object Bug257Test { - def sayhello(): Unit = { Console.println("I should come 1st and 2nd"); }; + def sayhello(): Unit = { Console.println("I should come 1st and 2nd"); }; def sayhi(): Unit = { Console.println("I should come last"); }; def f1(x: Unit): Unit = (); diff --git a/test/files/run/caseClassEquality.scala b/test/files/run/caseClassEquality.scala index c11d7ad0d1..4940d80951 100644 --- a/test/files/run/caseClassEquality.scala +++ b/test/files/run/caseClassEquality.scala @@ -11,25 +11,25 @@ object Test { case _ => false } } - + case class CS1(xs: Any*) class CS2(xs: Seq[_]*) extends CS1(xs: _*) class CS3(xs: IndexedSeq[Int]*) extends CS2(xs: _*) - + case class H1(x: Int, y: Double) class H2(x: Double, y: Int) extends H1(y, x) - + def main(args: Array[String]): Unit = { assert(C1(5) == new C2(5)) assert(new C2(5) == C1(5)) assert(C1(5).hashCode == new C2(5).hashCode) assert(new C2(5).hashCode == C1(5).hashCode) - + assert(C1(5) != new C3(5)) assert(new C3(5) != C1(5)) - + assert(CS1(List(1d,2d), Seq[Float](3f, 4f)) == new CS3(IndexedSeq(1,2), IndexedSeq(3, 4))) - + assert(H1(5, 10d) == new H2(10d, 5)) assert(H1(5, 10d).hashCode == new H2(10d, 5).hashCode) } diff --git a/test/files/run/castsingleton.scala b/test/files/run/castsingleton.scala index 339f5e00cf..47bd613079 100644 --- a/test/files/run/castsingleton.scala +++ b/test/files/run/castsingleton.scala @@ -8,4 +8,4 @@ object Test extends App { } empty(L()) -} +} diff --git a/test/files/run/checked.scala b/test/files/run/checked.scala index e4db9c0916..06bc0c05e5 100644 --- a/test/files/run/checked.scala +++ b/test/files/run/checked.scala @@ -23,9 +23,9 @@ trait T { // Should not throw class D extends B with T { val sum = x + y + z + b1 + b2 + t1 + t2 - override def toString = + override def toString = "sum = " + sum - + } abstract class NeedsXEarly { @@ -91,7 +91,7 @@ class TestInterference extends { object Test extends App { - + def shouldThrow(t: => Unit) = try { t println("[FAIL]: No UFE thrown") diff --git a/test/files/run/classof.scala b/test/files/run/classof.scala index b50facc1e9..10c07d2e51 100644 --- a/test/files/run/classof.scala +++ b/test/files/run/classof.scala @@ -13,14 +13,14 @@ object Test { println(classOf[Long]) println(classOf[Float]) println(classOf[Double]) - + println("Class types") println(classOf[SomeClass]) println(classOf[List[Array[Float]]]) println(classOf[(String, Map[Int, String])]) println("Arrays:") - println(classOf[Array[Unit]]) + println(classOf[Array[Unit]]) println(classOf[Array[Int]]) println(classOf[Array[Double]]) println(classOf[Array[List[String]]]) diff --git a/test/files/run/code.scala b/test/files/run/code.scala index e26f97b2a4..162f796c63 100644 --- a/test/files/run/code.scala +++ b/test/files/run/code.scala @@ -56,5 +56,5 @@ package baz { } - + diff --git a/test/files/run/collections-toSelf.scala b/test/files/run/collections-toSelf.scala index 02f1dd6a95..2adbc22af7 100644 --- a/test/files/run/collections-toSelf.scala +++ b/test/files/run/collections-toSelf.scala @@ -2,7 +2,7 @@ object Test { val map = Map(1 -> 2) val set = Set(1, 2) val seq = collection.immutable.Seq(1, 2) - + def main(args: Array[String]): Unit = { assert(map.toMap eq map) assert(set.toSet eq set) diff --git a/test/files/run/collections.scala b/test/files/run/collections.scala index deab5aa210..60f0765e6a 100644 --- a/test/files/run/collections.scala +++ b/test/files/run/collections.scala @@ -61,7 +61,7 @@ object Test extends App { } time { var x = 0 - for (i <- 0 to 10000) + for (i <- 0 to 10000) s get i match { case Some(i) => x += i case None => @@ -96,7 +96,7 @@ object Test extends App { } time { var x = 0 - for (i <- 0 to 10000) + for (i <- 0 to 10000) s get i match { case Some(i) => x += i case None => diff --git a/test/files/run/colltest1.scala b/test/files/run/colltest1.scala index 0e4c7e574c..1cbd932222 100644 --- a/test/files/run/colltest1.scala +++ b/test/files/run/colltest1.scala @@ -61,7 +61,7 @@ object Test extends App { assert(ten.toStream == ten) assert(ten.toString endsWith "(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)") assert(ten.mkString("[", "; ", "]") endsWith "[1; 2; 3; 4; 5; 6; 7; 8; 9; 10]") - } + } def orderedIterableTest(empty: Iterable[Int]) { orderedTraversableTest(empty) @@ -84,7 +84,7 @@ object Test extends App { assert(ten(0) == 1 && ten(9) == 10) assert((ten lengthCompare 10) == 0 && (ten lengthCompare 1) > 0 && (ten lengthCompare 11) < 0) assert((ten isDefinedAt 0) && (ten isDefinedAt 9)) - assert(!(ten isDefinedAt -1)); + assert(!(ten isDefinedAt -1)); assert(!(ten isDefinedAt 10)) val tenten = ten zip ten assert((tenten map (_._1)) == ten) @@ -174,8 +174,8 @@ object Test extends App { m ++= ('J' to 'Z') map (x => (x.toString -> x.toString)) println(m.toList.sorted) assert(!m.isEmpty) - assert(m.keySet forall (k => (m get k) == Some(k))) - assert(m.keySet forall (k => (m apply k) == k)) + assert(m.keySet forall (k => (m get k) == Some(k))) + assert(m.keySet forall (k => (m apply k) == k)) assert(m.keySet forall (m contains)) assert(m.getOrElse("7", "@") == "@") assert(m.keySet.size == 26) diff --git a/test/files/run/comparable-comparator.scala b/test/files/run/comparable-comparator.scala index aafe10eb59..ac943c63bb 100644 --- a/test/files/run/comparable-comparator.scala +++ b/test/files/run/comparable-comparator.scala @@ -1,7 +1,7 @@ object Test { import java.util.Comparator - + class C1(val s: String) extends Comparable[C1] { def compareTo(other: C1) = s compareTo other.s override def toString = s @@ -10,7 +10,7 @@ object Test { def compareTo(other: C2) = s compareTo other.s override def toString = s } - + implicit val cmp: Comparator[C2] = new Comparator[C2] { def compare(p1: C2, p2: C2) = p2.s compareTo p1.s } @@ -18,10 +18,10 @@ object Test { val strs = "zip foo bar baz aggle bing bong" split ' ' toList val c1s = strs map (x => new C1(x)) val c2s = strs map (x => new C2(x)) - + val sorted1 = c1s.sorted map (_.s) val sorted2 = c2s.sorted map (_.s) - + def main(args: Array[String]): Unit = { assert(sorted1 == sorted2.reverse) } diff --git a/test/files/run/concat-two-strings.scala b/test/files/run/concat-two-strings.scala index c8881aa146..ad796fe0ee 100644 --- a/test/files/run/concat-two-strings.scala +++ b/test/files/run/concat-two-strings.scala @@ -8,7 +8,7 @@ object Test { def f4(x: List[Int]) = "" + x def f5(x: Any) = "" + x def f6(x: AnyVal) = "" + x - + def main(args: Array[String]): Unit = { List(f1("a"), f2(5), f3(null), f3(Array('a')), f4(List(1)), f5(null), f6(55d)) mkString "" } diff --git a/test/files/run/constrained-types.check b/test/files/run/constrained-types.check index 963dd4a059..ac8817cb08 100644 --- a/test/files/run/constrained-types.check +++ b/test/files/run/constrained-types.check @@ -14,7 +14,7 @@ scala> class A { val x = "hello" val y: Int @Annot(x) = 10 override def toString = "an A" -} +} defined class A scala> @@ -22,7 +22,7 @@ scala> scala> val a = new A a: A = an A -scala> val y = a.y // should rewrite "this.x" to "a.x" +scala> val y = a.y // should rewrite "this.x" to "a.x" y: Int @Annot(a.x) = 10 scala> var a2 = new A diff --git a/test/files/run/constrained-types.scala b/test/files/run/constrained-types.scala index 91bd856d00..38ae076c06 100644 --- a/test/files/run/constrained-types.scala +++ b/test/files/run/constrained-types.scala @@ -15,10 +15,10 @@ class A { val x = "hello" val y: Int @Annot(x) = 10 override def toString = "an A" -} +} val a = new A -val y = a.y // should rewrite "this.x" to "a.x" +val y = a.y // should rewrite "this.x" to "a.x" var a2 = new A val y2 = a2.y // should drop the annotation diff --git a/test/files/run/ctor-order.scala b/test/files/run/ctor-order.scala index 5f5871691a..a223ff77e8 100644 --- a/test/files/run/ctor-order.scala +++ b/test/files/run/ctor-order.scala @@ -8,7 +8,7 @@ class Outer { class X extends { /* The constructor of X should set this.$outer to the outer instance - * *before* calling the super constructors. This is tested by + * *before* calling the super constructors. This is tested by * mixin M1, which tries to access global from the enclosing class. */ val outer = Outer.this diff --git a/test/files/run/distinct.scala b/test/files/run/distinct.scala index 698d31f1e9..09e5a0734a 100644 --- a/test/files/run/distinct.scala +++ b/test/files/run/distinct.scala @@ -5,7 +5,7 @@ object Test { val alphabet = 'a' to 'z' mkString "" val alphaList = 'a' to 'z' toList def shuffled = util.Random.shuffle(alphaList) - + def main(args: Array[String]): Unit = { val longList = alphaList ++ (1 to 9 flatMap (_ => shuffled)) val result = longList.distinct mkString "" diff --git a/test/files/run/elidable-noflags.scala b/test/files/run/elidable-noflags.scala index 1b9c5118bb..5192e34096 100644 --- a/test/files/run/elidable-noflags.scala +++ b/test/files/run/elidable-noflags.scala @@ -9,7 +9,7 @@ object Test { @elidable(100000) def f5() = println("Good for me, I was not elided.") @elidable(OFF) def f6() = println("Good for me, I was not elided.") @elidable(ALL) def f7() = println("ESPECIALLY good for me, I was not elided.") - + def main(args: Array[String]): Unit = { f1() f2() diff --git a/test/files/run/elidable.scala b/test/files/run/elidable.scala index 2a527efc4b..264efbad59 100644 --- a/test/files/run/elidable.scala +++ b/test/files/run/elidable.scala @@ -6,7 +6,7 @@ object Test { @elidable(INFO) def f2() = assert(false, "Should have been elided.") @elidable(SEVERE) def f3() = println("Good for me, I was not elided.") @elidable(INFO) def f4 = assert(false, "Should have been elided (no parens).") - + def main(args: Array[String]): Unit = { f1() f2() diff --git a/test/files/run/emptypf.scala b/test/files/run/emptypf.scala index eb3e3e6380..8aa0906a1b 100644 --- a/test/files/run/emptypf.scala +++ b/test/files/run/emptypf.scala @@ -5,10 +5,10 @@ object Test { case s => s.length } } - + def main(args: Array[String]): Unit = { println(f("abc")) - println(f("def")) + println(f("def")) println(PartialFunction.empty[String, Int] isDefinedAt "abc") } } diff --git a/test/files/run/equality.scala b/test/files/run/equality.scala index ff59898821..68055fd012 100644 --- a/test/files/run/equality.scala +++ b/test/files/run/equality.scala @@ -2,7 +2,7 @@ object Test { import scala.runtime.ScalaRunTime.hash - + def makeFromInt(x: Int) = List( x.toByte, x.toShort, x.toInt, x.toLong, x.toFloat, x.toDouble, BigInt(x), BigDecimal(x) ) ::: ( @@ -11,26 +11,26 @@ object Test def makeFromDouble(x: Double) = List( x.toShort, x.toInt, x.toLong, x.toFloat, x.toDouble, BigInt(x.toInt), BigDecimal(x) ) - + def main(args: Array[String]): Unit = { var xs = makeFromInt(5) for (x <- xs ; y <- xs) { assert(x == y, x + " == " + y) assert(hash(x) == hash(y), "hash(%s) == hash(%s)".format(x, y)) } - + xs = makeFromInt(-5) for (x <- xs ; y <- xs) { assert(x == y, x + " == " + y) assert(hash(x) == hash(y), "hash(%s) == hash(%s)".format(x, y)) } - + xs = makeFromDouble(500.0) for (x <- xs ; y <- xs) { assert(x == y, x + " == " + y) assert(hash(x) == hash(y), "hash(%s) == hash(%s)".format(x, y)) } - + // negatives val bigLong = new java.util.concurrent.atomic.AtomicLong(Long.MaxValue) assert(-1 != bigLong && bigLong != -1) // bigLong.intValue() == -1 diff --git a/test/files/run/exceptions-2.scala b/test/files/run/exceptions-2.scala index 05aab66dd0..d0312a49b2 100644 --- a/test/files/run/exceptions-2.scala +++ b/test/files/run/exceptions-2.scala @@ -68,7 +68,7 @@ object Test { Console.println("Outermost finally"); } - def mixed = + def mixed = try { if (10 > 0) throw Leaf(10); @@ -107,7 +107,7 @@ object Test { case Leaf(a) => Console.println(a); } } catch { - case npe: NullPointerException => + case npe: NullPointerException => Console.println("Caught an NPE"); } @@ -141,14 +141,14 @@ object Test { } } - def valInFinally: Unit = - try { + def valInFinally: Unit = + try { } finally { val fin = "Abc"; Console.println(fin); }; - def tryAndValInFinally: Unit = + def tryAndValInFinally: Unit = try { } finally { val fin = "Abc"; @@ -157,51 +157,51 @@ object Test { } catch { case _ => () } }; - def returnInBody: Unit = try { + def returnInBody: Unit = try { try { Console.println("Normal execution..."); - return + return Console.println("non reachable code"); } finally { Console.println("inner finally"); } - } finally { + } finally { Console.println("Outer finally"); } - def returnInBodySynch: Unit = try { + def returnInBodySynch: Unit = try { synchronized { try { Console.println("Synchronized normal execution..."); - return + return Console.println("non reachable code"); } finally { Console.println("inner finally"); } } - } finally { + } finally { Console.println("Outer finally"); } - def returnInBodyAndInFinally: Unit = try { + def returnInBodyAndInFinally: Unit = try { try { Console.println("Normal execution..."); - return + return Console.println("non reachable code"); } finally { Console.println("inner finally"); return } - } finally { + } finally { Console.println("Outer finally"); return } - def returnInBodyAndInFinally2: Unit = try { + def returnInBodyAndInFinally2: Unit = try { try { Console.println("Normal execution..."); - return + return Console.println("non reachable code"); } finally { try { @@ -211,7 +211,7 @@ object Test { Console.println("finally inside finally"); } } - } finally { + } finally { Console.println("Outer finally"); return } @@ -253,7 +253,7 @@ object Test { } - def returnWithFinallyClean: Int = try { + def returnWithFinallyClean: Int = try { try { Console.println("Normal execution..."); return 10 @@ -262,7 +262,7 @@ object Test { } finally { Console.println("inner finally"); } - } finally { + } finally { Console.println("Outer finally"); try { 1 } catch { case e: java.io.IOException => () } } @@ -294,7 +294,7 @@ object Test { Console.println("mixed: "); execute(mixed); - + Console.println("withValue1:"); execute(withValue1); @@ -322,7 +322,7 @@ object Test { Console.println("NoExcep.method3:"); execute(NoExcep.method3); - + Console.println("NoExcep.method4:"); execute(NoExcep.method4); diff --git a/test/files/run/existentials.scala b/test/files/run/existentials.scala index ff52cc0040..3977d47417 100644 --- a/test/files/run/existentials.scala +++ b/test/files/run/existentials.scala @@ -2,7 +2,7 @@ class Foo { class Line { case class Cell[T](var x: T) def f[T](x: Any): Cell[t1] forSome { type t1 } = x match { case y: Cell[t] => y } - + var x: Cell[T] forSome { type T } = new Cell(1) println({ x = new Cell("abc"); x }) } @@ -12,7 +12,7 @@ class FooW { class Line { case class Cell[T](var x: T) def f[T](x: Any): Cell[ _ ] = x match { case y: Cell[t] => y } - + var x: Cell[_] = new Cell(1) println({ x = new Cell("abc"); x }) } diff --git a/test/files/run/finally.scala b/test/files/run/finally.scala index b3b7f684e5..635123cc4d 100644 --- a/test/files/run/finally.scala +++ b/test/files/run/finally.scala @@ -10,7 +10,7 @@ object Test extends App { case e => println(e) } } - + // test that finally is not covered by any exception handlers. def bar { try { @@ -26,7 +26,7 @@ object Test extends App { } // return in catch (finally is executed) - def retCatch { + def retCatch { try { throw new Exception } catch { @@ -37,7 +37,7 @@ object Test extends App { } // throw in catch (finally is executed, exception propagated) - def throwCatch { + def throwCatch { try { throw new Exception } catch { @@ -48,7 +48,7 @@ object Test extends App { } // return inside body (finally is executed) - def retBody { + def retBody { try { return } catch { @@ -75,7 +75,7 @@ object Test extends App { finally { println("in finally 1") return - } + } } finally println("in finally 2") } @@ -94,7 +94,7 @@ object Test extends App { } // nested finallies with return value - def nestedFinalies: Int = + def nestedFinalies: Int = try { try { return 10 diff --git a/test/files/run/flat-flat-flat.scala b/test/files/run/flat-flat-flat.scala index 80868b9c5e..d57696b3a3 100644 --- a/test/files/run/flat-flat-flat.scala +++ b/test/files/run/flat-flat-flat.scala @@ -2,7 +2,7 @@ object Test { def f1 = List(Iterator(Some(1), None, Some(2)), Iterator(Some(3), None)) def f2 = Iterator(List(Some(1), None, Some(2)), List(Some(3), None), Nil) def f3 = List(Some(Iterator(1)), None, Some(Iterator(2, 3))) - + def main(args: Array[String]): Unit = { assert(f1.flatten.flatten.toList == List(1, 2, 3)) assert(f2.flatten.flatten.toList == List(1, 2, 3)) diff --git a/test/files/run/forvaleq.scala b/test/files/run/forvaleq.scala index 8c1824a769..2a958802b6 100644 --- a/test/files/run/forvaleq.scala +++ b/test/files/run/forvaleq.scala @@ -2,7 +2,7 @@ import scala.collection.immutable.Queue import scala.{List=>L} - + object Test { // redefine some symbols to make it extra hard class List @@ -16,11 +16,11 @@ object Test { case _ if (x<10) => x case _ => firstDigit(x / 10) } - - + + { - // a basic test case - + // a basic test case + val input = L.range(0,20) val oddFirstTimesTwo = for {x <- input @@ -32,7 +32,7 @@ object Test { { // a test case with patterns - + val input = L.range(0, 20) val oddFirstTimesTwo = for {x <- input @@ -43,10 +43,10 @@ object Test { 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).iterator val oddFirstTimesTwo = @@ -54,36 +54,36 @@ object Test { xf = firstDigit(x) if xf % 2 == 1} yield x*2 - println(oddFirstTimesTwo.toList) + 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) + 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") } diff --git a/test/files/run/gadts.scala b/test/files/run/gadts.scala index 57c7fc8af0..4ab3ef681a 100644 --- a/test/files/run/gadts.scala +++ b/test/files/run/gadts.scala @@ -2,8 +2,8 @@ abstract class Term[T] case class Lit(x: Int) extends Term[Int] case class Succ(t: Term[Int]) extends Term[Int] case class IsZero(t: Term[Int]) extends Term[Boolean] -case class If[T](c: Term[Boolean], - t1: Term[T], +case class If[T](c: Term[Boolean], + t1: Term[T], t2: Term[T]) extends Term[T] object Test extends App { diff --git a/test/files/run/getClassTest.scala b/test/files/run/getClassTest.scala index 951cc8d931..2485cd2c71 100644 --- a/test/files/run/getClassTest.scala +++ b/test/files/run/getClassTest.scala @@ -4,7 +4,7 @@ class AnyVals { def f3 = 5.getClass def f4 = (5: java.lang.Integer).getClass def f5 = (5.asInstanceOf[AnyRef]).getClass - + // scalap says: // // def f1 : java.lang.Class[?0] forSome {type ?0} = { /* compiled code */ } @@ -19,18 +19,18 @@ class AnyVals { // f2: java.lang.Class // f3: java.lang.Class // f4: java.lang.Class - // f5: java.lang.Class + // f5: java.lang.Class } class AnyRefs { class A class B extends A - + def f1 = (new B: Any).getClass().newInstance() def f2 = (new B: AnyRef).getClass().newInstance() def f3 = (new B: A).getClass().newInstance() def f4 = (new B: B).getClass().newInstance() - + def f0[T >: B] = (new B: T).getClass().newInstance() def f5 = f0[Any] @@ -52,7 +52,7 @@ class MoreAnyRefs { object Test { def returnTypes[T: Manifest] = ( - manifest[T].erasure.getMethods.toList + manifest[T].erasure.getMethods.toList filter (_.getName startsWith "f") sortBy (_.getName) map (m => m.getName + ": " + m.getGenericReturnType.toString) diff --git a/test/files/run/global-showdef.scala b/test/files/run/global-showdef.scala index e17f438247..71ba7b8bb3 100644 --- a/test/files/run/global-showdef.scala +++ b/test/files/run/global-showdef.scala @@ -39,8 +39,8 @@ object Bippy { new Global(settings) } - - def slurp(body: => Unit): String = stringFromStream { stream => + + def slurp(body: => Unit): String = stringFromStream { stream => Console.withOut(stream) { Console.withErr(stream) { body @@ -57,11 +57,11 @@ object Bippy { } def showClass(name: String) = lines("-Yshow:typer", "-Xshow-class", name) def showObject(name: String) = lines("-Yshow:typer", "-Xshow-object", name) - + def show(xs: List[String]) = { xs filter (x => (x contains "def showdefTestMember") || (x startsWith "<<-- ")) foreach println } - + def main(args: Array[String]) { show(List("Bippy", "Bippy#BippyType", "Bippy.BippyType", "Bippy#Boppity", "Bippy#Boppity#Boo") flatMap showClass) show(List("Bippy", "Bippy#Boppity#Boo") flatMap showObject) diff --git a/test/files/run/groupby.scala b/test/files/run/groupby.scala index a751e65e80..fe08f52812 100644 --- a/test/files/run/groupby.scala +++ b/test/files/run/groupby.scala @@ -3,8 +3,8 @@ // Fixes #3422 object Test { - - def main(args: Array[String]) { + + def main(args: Array[String]) { val arr = Array.range(0,10) val map = arr groupBy (_%2) val v1 = map(0) @@ -14,5 +14,5 @@ object Test { // hash map by default. assert(v1 eq v2) } - + } diff --git a/test/files/run/hashCodeBoxesRunTime.scala b/test/files/run/hashCodeBoxesRunTime.scala index ba1a30f5fb..081a73376e 100644 --- a/test/files/run/hashCodeBoxesRunTime.scala +++ b/test/files/run/hashCodeBoxesRunTime.scala @@ -4,16 +4,16 @@ object Test { import java.{ lang => jl } import scala.runtime.BoxesRunTime.{ hashFromNumber, hashFromObject } - + def allSame[T](xs: List[T]) = assert(xs.distinct.size == 1, "failed: " + xs) - + def mkNumbers(x: Int): List[Number] = List(x.toByte, x.toShort, x, x.toLong, x.toFloat, x.toDouble) - + def testLDF(x: Long) = allSame(List[Number](x, x.toDouble, x.toFloat) map hashFromNumber) - + def main(args: Array[String]): Unit = { - List(Byte.MinValue, -1, 0, 1, Byte.MaxValue) foreach { n => + List(Byte.MinValue, -1, 0, 1, Byte.MaxValue) foreach { n => val hashes = mkNumbers(n) map hashFromNumber allSame(hashes) if (n >= 0) { @@ -21,7 +21,7 @@ object Test assert(charCode == hashes.head) } } - + testLDF(Short.MaxValue.toLong) testLDF(Short.MinValue.toLong) } diff --git a/test/files/run/hashhash.scala b/test/files/run/hashhash.scala index d3800be876..b9cec99a12 100644 --- a/test/files/run/hashhash.scala +++ b/test/files/run/hashhash.scala @@ -1,7 +1,7 @@ object Test { def confirmSame(x: Any) = assert(x.## == x.hashCode, "%s.## != %s.hashCode".format(x, x)) def confirmDifferent(x: Any) = assert(x.## != x.hashCode, "%s.## == %s.hashCode (but should not)".format(x, x)) - + def main(args: Array[String]): Unit = { /** Just a little sanity check, not to be confused with a unit test. */ List(5, 5.5f, "abc", new AnyRef, ()) foreach confirmSame diff --git a/test/files/run/indexedSeq.scala b/test/files/run/indexedSeq.scala index 19308e1d8c..9744f47f63 100644 --- a/test/files/run/indexedSeq.scala +++ b/test/files/run/indexedSeq.scala @@ -1,8 +1,8 @@ object Test { import scala.collection.{ mutable, immutable, generic } - + def checkIdentity[A](xs: immutable.IndexedSeq[A]) = assert(xs.toIndexedSeq eq xs) - + def main(args: Array[String]): Unit = { checkIdentity(immutable.Vector(1 to 10: _*)) checkIdentity(1 to 10 toIndexedSeq) diff --git a/test/files/run/infix.scala b/test/files/run/infix.scala index ba77480297..700e4347ac 100644 --- a/test/files/run/infix.scala +++ b/test/files/run/infix.scala @@ -9,4 +9,4 @@ object Test extends App { case null op (0, 0) op (1, 1) op (2, 2) => Console.println("OK") } } - + diff --git a/test/files/run/inliner-infer.scala b/test/files/run/inliner-infer.scala index 027d25b6e2..ea83966c52 100644 --- a/test/files/run/inliner-infer.scala +++ b/test/files/run/inliner-infer.scala @@ -7,8 +7,8 @@ object Test extends App { @annotation.tailrec def walk(xs: MyList): Unit = { - if (xs.isEmpty) - println("empty") + if (xs.isEmpty) + println("empty") else { println("non-empty") walk(MyNil) @@ -26,4 +26,4 @@ object MyNil extends MyList { override def isEmpty = true } - + diff --git a/test/files/run/inner-obj-auto.scala b/test/files/run/inner-obj-auto.scala index 98b48b150f..aa2e29326f 100644 --- a/test/files/run/inner-obj-auto.scala +++ b/test/files/run/inner-obj-auto.scala @@ -3,15 +3,15 @@ /* ================================================================================ Automatically generated on 2011-05-11. Do Not Edit (unless you have to). (2-level nesting) - ================================================================================ */ + ================================================================================ */ class Class2_1 { - + class Class1_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -31,16 +31,16 @@ class Class2_1 { def run { runTest } } - + def run { (new Class1_2).run } } object Object3_1 { - + class Class1_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -60,16 +60,16 @@ object Object3_1 { def run { runTest } } - + def run { (new Class1_2).run } // trigger } trait Trait4_1 { - + class Class1_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -89,16 +89,16 @@ trait Trait4_1 { def run { runTest } } - + def run { (new Class1_2).run } } class Class6_1 { - + object Object5_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -118,16 +118,16 @@ class Class6_1 { def run { runTest } // trigger } - + def run { Object5_2.run } } object Object7_1 { - + object Object5_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -147,16 +147,16 @@ object Object7_1 { def run { runTest } // trigger } - + def run { Object5_2.run } // trigger } trait Trait8_1 { - + object Object5_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -176,16 +176,16 @@ trait Trait8_1 { def run { runTest } // trigger } - + def run { Object5_2.run } } class Class10_1 { - + trait Trait9_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -205,16 +205,16 @@ class Class10_1 { def run { runTest } } - + def run { (new Trait9_2 {}).run } } object Object11_1 { - + trait Trait9_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -234,16 +234,16 @@ object Object11_1 { def run { runTest } } - + def run { (new Trait9_2 {}).run } // trigger } trait Trait12_1 { - + trait Trait9_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -263,16 +263,16 @@ trait Trait12_1 { def run { runTest } } - + def run { (new Trait9_2 {}).run } } class Class14_1 { - + def method13_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -292,16 +292,16 @@ class Class14_1 { runTest // trigger } - + def run { method13_2 } } object Object15_1 { - + def method13_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -321,16 +321,16 @@ object Object15_1 { runTest // trigger } - + def run { method13_2 } // trigger } trait Trait16_1 { - + def method13_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -350,16 +350,16 @@ trait Trait16_1 { runTest // trigger } - + def run { method13_2 } } class Class18_1 { - + private def method17_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -379,16 +379,16 @@ class Class18_1 { runTest // trigger } - + def run { method17_2 } } object Object19_1 { - + private def method17_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -408,16 +408,16 @@ object Object19_1 { runTest // trigger } - + def run { method17_2 } // trigger } trait Trait20_1 { - + private def method17_2 { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -437,16 +437,16 @@ trait Trait20_1 { runTest // trigger } - + def run { method17_2 } } class Class22_1 { - + val fun21_2 = () => { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -466,16 +466,16 @@ class Class22_1 { runTest // trigger } - + def run { fun21_2() } } object Object23_1 { - + val fun21_2 = () => { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -495,16 +495,16 @@ object Object23_1 { runTest // trigger } - + def run { fun21_2() } // trigger } trait Trait24_1 { - + val fun21_2 = () => { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -524,17 +524,17 @@ trait Trait24_1 { runTest // trigger } - + def run { fun21_2() } } class Class26_1 { - + class Class25_2 { - { // in primary constructor + { // in primary constructor var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -553,19 +553,19 @@ class Class26_1 { } runTest // trigger - } + } } - + def run { (new Class25_2) } } object Object27_1 { - + class Class25_2 { - { // in primary constructor + { // in primary constructor var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -584,19 +584,19 @@ object Object27_1 { } runTest // trigger - } + } } - + def run { (new Class25_2) } // trigger } trait Trait28_1 { - + class Class25_2 { - { // in primary constructor + { // in primary constructor var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -615,19 +615,19 @@ trait Trait28_1 { } runTest // trigger - } + } } - + def run { (new Class25_2) } } class Class30_1 { - + trait Trait29_2 { - { // in primary constructor + { // in primary constructor var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -646,19 +646,19 @@ class Class30_1 { } runTest // trigger - } + } } - + def run { (new Trait29_2 {}) } } object Object31_1 { - + trait Trait29_2 { - { // in primary constructor + { // in primary constructor var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -677,19 +677,19 @@ object Object31_1 { } runTest // trigger - } + } } - + def run { (new Trait29_2 {}) } // trigger } trait Trait32_1 { - + trait Trait29_2 { - { // in primary constructor + { // in primary constructor var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -708,18 +708,18 @@ trait Trait32_1 { } runTest // trigger - } + } } - + def run { (new Trait29_2 {}) } } class Class34_1 { - + lazy val lzvalue33_2 = { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -739,16 +739,16 @@ class Class34_1 { runTest // trigger } - + def run { lzvalue33_2 } } object Object35_1 { - + lazy val lzvalue33_2 = { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -768,16 +768,16 @@ object Object35_1 { runTest // trigger } - + def run { lzvalue33_2 } // trigger } trait Trait36_1 { - + lazy val lzvalue33_2 = { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -797,16 +797,16 @@ trait Trait36_1 { runTest // trigger } - + def run { lzvalue33_2 } } class Class38_1 { - + val value37_2 = { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -826,16 +826,16 @@ class Class38_1 { runTest // trigger } - + def run { value37_2 } } object Object39_1 { - + val value37_2 = { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -855,16 +855,16 @@ object Object39_1 { runTest // trigger } - + def run { value37_2 } // trigger } trait Trait40_1 { - + val value37_2 = { var ObjCounter = 0 - + object Obj { ObjCounter += 1} Obj // one @@ -884,16 +884,16 @@ trait Trait40_1 { runTest // trigger } - + def run { value37_2 } } class Class42_1 { - + class Class41_2 { var ObjCounter = 0 - + private object Obj { ObjCounter += 1} Obj // one @@ -913,16 +913,16 @@ class Class42_1 { def run { runTest } } - + def run { (new Class41_2).run } } object Object43_1 { - + class Class41_2 { var ObjCounter = 0 - + private object Obj { ObjCounter += 1} Obj // one @@ -942,16 +942,16 @@ object Object43_1 { def run { runTest } } - + def run { (new Class41_2).run } // trigger } trait Trait44_1 { - + class Class41_2 { var ObjCounter = 0 - + private object Obj { ObjCounter += 1} Obj // one @@ -971,16 +971,16 @@ trait Trait44_1 { def run { runTest } } - + def run { (new Class41_2).run } } class Class46_1 { - + object Object45_2 { var ObjCounter = 0 - + private object Obj { ObjCounter += 1} Obj // one @@ -1000,16 +1000,16 @@ class Class46_1 { def run { runTest } // trigger } - + def run { Object45_2.run } } object Object47_1 { - + object Object45_2 { var ObjCounter = 0 - + private object Obj { ObjCounter += 1} Obj // one @@ -1029,16 +1029,16 @@ object Object47_1 { def run { runTest } // trigger } - + def run { Object45_2.run } // trigger } trait Trait48_1 { - + object Object45_2 { var ObjCounter = 0 - + private object Obj { ObjCounter += 1} Obj // one @@ -1058,16 +1058,16 @@ trait Trait48_1 { def run { runTest } // trigger } - + def run { Object45_2.run } } class Class50_1 { - + trait Trait49_2 { var ObjCounter = 0 - + private object Obj { ObjCounter += 1} Obj // one @@ -1087,16 +1087,16 @@ class Class50_1 { def run { runTest } } - + def run { (new Trait49_2 {}).run } } object Object51_1 { - + trait Trait49_2 { var ObjCounter = 0 - + private object Obj { ObjCounter += 1} Obj // one @@ -1116,16 +1116,16 @@ object Object51_1 { def run { runTest } } - + def run { (new Trait49_2 {}).run } // trigger } trait Trait52_1 { - + trait Trait49_2 { var ObjCounter = 0 - + private object Obj { ObjCounter += 1} Obj // one @@ -1145,16 +1145,16 @@ trait Trait52_1 { def run { runTest } } - + def run { (new Trait49_2 {}).run } } class Class54_1 { - + class Class53_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1178,16 +1178,16 @@ class Class54_1 { def run { runTest } } - + def run { (new Class53_2).run } } object Object55_1 { - + class Class53_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1211,16 +1211,16 @@ object Object55_1 { def run { runTest } } - + def run { (new Class53_2).run } // trigger } trait Trait56_1 { - + class Class53_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1244,16 +1244,16 @@ trait Trait56_1 { def run { runTest } } - + def run { (new Class53_2).run } } class Class58_1 { - + object Object57_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1277,16 +1277,16 @@ class Class58_1 { def run { runTest } // trigger } - + def run { Object57_2.run } } object Object59_1 { - + object Object57_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1310,16 +1310,16 @@ object Object59_1 { def run { runTest } // trigger } - + def run { Object57_2.run } // trigger } trait Trait60_1 { - + object Object57_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1343,16 +1343,16 @@ trait Trait60_1 { def run { runTest } // trigger } - + def run { Object57_2.run } } class Class62_1 { - + trait Trait61_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1376,16 +1376,16 @@ class Class62_1 { def run { runTest } } - + def run { (new Trait61_2 {}).run } } object Object63_1 { - + trait Trait61_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1409,16 +1409,16 @@ object Object63_1 { def run { runTest } } - + def run { (new Trait61_2 {}).run } // trigger } trait Trait64_1 { - + trait Trait61_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1442,16 +1442,16 @@ trait Trait64_1 { def run { runTest } } - + def run { (new Trait61_2 {}).run } } class Class66_1 { - + def method65_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1475,16 +1475,16 @@ class Class66_1 { runTest // trigger } - + def run { method65_2 } } object Object67_1 { - + def method65_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1508,16 +1508,16 @@ object Object67_1 { runTest // trigger } - + def run { method65_2 } // trigger } trait Trait68_1 { - + def method65_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1541,16 +1541,16 @@ trait Trait68_1 { runTest // trigger } - + def run { method65_2 } } class Class70_1 { - + private def method69_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1574,16 +1574,16 @@ class Class70_1 { runTest // trigger } - + def run { method69_2 } } object Object71_1 { - + private def method69_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1607,16 +1607,16 @@ object Object71_1 { runTest // trigger } - + def run { method69_2 } // trigger } trait Trait72_1 { - + private def method69_2 { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1640,16 +1640,16 @@ trait Trait72_1 { runTest // trigger } - + def run { method69_2 } } class Class74_1 { - + val fun73_2 = () => { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1673,16 +1673,16 @@ class Class74_1 { runTest // trigger } - + def run { fun73_2() } } object Object75_1 { - + val fun73_2 = () => { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1706,16 +1706,16 @@ object Object75_1 { runTest // trigger } - + def run { fun73_2() } // trigger } trait Trait76_1 { - + val fun73_2 = () => { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1739,17 +1739,17 @@ trait Trait76_1 { runTest // trigger } - + def run { fun73_2() } } class Class78_1 { - + class Class77_2 { - { // in primary constructor + { // in primary constructor @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1772,19 +1772,19 @@ class Class78_1 { } runTest // trigger - } + } } - + def run { (new Class77_2) } } object Object79_1 { - + class Class77_2 { - { // in primary constructor + { // in primary constructor @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1807,19 +1807,19 @@ object Object79_1 { } runTest // trigger - } + } } - + def run { (new Class77_2) } // trigger } trait Trait80_1 { - + class Class77_2 { - { // in primary constructor + { // in primary constructor @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1842,19 +1842,19 @@ trait Trait80_1 { } runTest // trigger - } + } } - + def run { (new Class77_2) } } class Class82_1 { - + trait Trait81_2 { - { // in primary constructor + { // in primary constructor @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1877,19 +1877,19 @@ class Class82_1 { } runTest // trigger - } + } } - + def run { (new Trait81_2 {}) } } object Object83_1 { - + trait Trait81_2 { - { // in primary constructor + { // in primary constructor @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1912,19 +1912,19 @@ object Object83_1 { } runTest // trigger - } + } } - + def run { (new Trait81_2 {}) } // trigger } trait Trait84_1 { - + trait Trait81_2 { - { // in primary constructor + { // in primary constructor @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1947,18 +1947,18 @@ trait Trait84_1 { } runTest // trigger - } + } } - + def run { (new Trait81_2 {}) } } class Class90_1 { - + val value89_2 = { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -1982,16 +1982,16 @@ class Class90_1 { runTest // trigger } - + def run { value89_2 } } trait Trait92_1 { - + val value89_2 = { @volatile var ObjCounter = 0 - + object Obj { ObjCounter += 1} def multiThreadedAccess() { @@ -2015,7 +2015,7 @@ trait Trait92_1 { runTest // trigger } - + def run { value89_2 } } diff --git a/test/files/run/io-position.scala b/test/files/run/io-position.scala index 7e570ea29e..1093704fa4 100644 --- a/test/files/run/io-position.scala +++ b/test/files/run/io-position.scala @@ -1,13 +1,13 @@ object Test { Console.setErr(Console.out) - - def main(args: Array[String]): Unit = { + + def main(args: Array[String]): Unit = { try { xml.parsing.ConstructingParser.fromSource(io.Source.fromString(""), false).document() } catch { case e:Exception => println(e.getMessage) } - } + } -} +} diff --git a/test/files/run/iq.scala b/test/files/run/iq.scala index 31859cf867..e5f9e4705a 100644 --- a/test/files/run/iq.scala +++ b/test/files/run/iq.scala @@ -9,8 +9,8 @@ object iq { /* Create an empty queue. */ val q: Queue[Int] = Queue.empty - /* Test isEmpty. - * Expected: Empty + /* Test isEmpty. + * Expected: Empty */ if (q.isEmpty) { Console.println("Empty") @@ -20,14 +20,14 @@ object iq { //val q2 = q + 42 + 0 // deprecated val q2 = q.enqueue(42).enqueue(0) - /* Test is empty and dequeue. + /* 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) @@ -36,8 +36,8 @@ object iq { /* 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) + /* Test toString. + * Expected: Head: q5: Queue(0,1,2,3,4,5,6,7,8,9) */ Console.println("q5: " + q5) /* Test apply @@ -59,7 +59,7 @@ object iq { //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) + * Expected: q8: Queue(2,3,4,5,6,7,8,9,10,11) */ Console.println("q8: " + q8) val q9 = Queue(2,3,4,5,6,7,8,9,10,11) @@ -70,14 +70,14 @@ object iq { Console.println("q8 == q9: " + (q8 == q9)) /* Testing elements - * Expected: Elements: 1 2 3 4 5 6 7 8 9 + * Expected: Elements: 1 2 3 4 5 6 7 8 9 */ - Console.print("Elements: "); + Console.print("Elements: "); q6.iterator.foreach(e => Console.print(" "+ e + " ")) - Console.println; + Console.println; /* Testing mkString - * Expected: String: <1-2-3-4-5-6-7-8-9> + * Expected: String: <1-2-3-4-5-6-7-8-9> */ Console.println("String: " + q6.mkString("<","-",">")) @@ -89,7 +89,7 @@ object iq { /* Testing front * Expected: Front: 1 */ - Console.println("Front: " + q6.front); + Console.println("Front: " + q6.front); } } diff --git a/test/files/run/is-valid-num.scala b/test/files/run/is-valid-num.scala index 6e423e946e..f919a21dee 100644 --- a/test/files/run/is-valid-num.scala +++ b/test/files/run/is-valid-num.scala @@ -1,7 +1,7 @@ object Test { def x = BigInt("10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") def y = BigDecimal("" + (Short.MaxValue + 1) + ".0") - + def l1 = Int.MaxValue.toLong + 1 def l2 = Int.MinValue.toLong - 1 diff --git a/test/files/run/issue192.scala b/test/files/run/issue192.scala index 8acd3a6345..d8db8b5816 100644 --- a/test/files/run/issue192.scala +++ b/test/files/run/issue192.scala @@ -1,16 +1,16 @@ object Test extends App { - + def f1(p: Any{def unary_+ : Int}) = +p def f2(p: Any{def unary_- : Int}) = -p def f3(p: Any{def unary_~ : Int}) = ~p def f4(p: Any{def unary_! : Boolean}) = !p - + def f5(p: Any{def +(q: Int): Int}) = p + 7 def f6(p: Any{def -(q: Int): Int}) = p - 7 def f7(p: Any{def *(q: Int): Int}) = p * 7 def f8(p: Any{def /(q: Int): Int}) = p / 7 def f9(p: Any{def %(q: Int): Int}) = p % 7 - + def f10(p: Any{def |(q: Int): Int}) = p | 7 def f11(p: Any{def |(q: Boolean): Boolean}) = p | true def f12(p: Any{def ^(q: Int): Int}) = p ^ 7 @@ -19,11 +19,11 @@ object Test extends App { def f15(p: Any{def &(q: Boolean): Boolean}) = p & true def f16(p: Any{def ||(q: Boolean): Boolean}) = p || true def f17(p: Any{def &&(q: Boolean): Boolean}) = p && true - + def f18(p: Any{def <<(q: Int): Int}) = p << 7 def f19(p: Any{def >>(q: Int): Int}) = p >> 7 def f20(p: Any{def >>>(q: Int): Int}) = p >>> 7 - + def f21(p: Any{def toByte: Byte}) = p.toByte def f22(p: Any{def toShort: Short}) = p.toShort def f23(p: Any{def toChar: Char}) = p.toChar @@ -31,28 +31,28 @@ object Test extends App { def f25(p: Any{def toLong: Long}) = p.toLong def f26(p: Any{def toFloat: Float}) = p.toFloat def f27(p: Any{def toDouble: Double}) = p.toDouble - + def f28(p: Any{def ==(q: Int): Boolean}) = p == 7 def f29(p: Any{def !=(q: Int): Boolean}) = p != 7 def f30(p: Any{def ==(q: Boolean): Boolean}) = p == true def f31(p: Any{def !=(q: Boolean): Boolean}) = p != true - + def f32(p: Any{def <(q: Int): Boolean}) = p < 7 def f33(p: Any{def <=(q: Int): Boolean}) = p <= 7 def f34(p: Any{def >=(q: Int): Boolean}) = p >= 7 def f35(p: Any{def >(q: Int): Boolean}) = p > 7 - + print("f1 = "); println(f1(1) == +1) print("f2 = "); println(f2(1) == -1) print("f3 = "); println(f3(1) == ~1) print("f4 = "); println(f4(true) == !true) - + print("f5 = "); println(f5(4) == (4 + 7)) print("f6 = "); println(f6(4) == (4 - 7)) print("f7 = "); println(f7(4) == (4 * 7)) print("f8 = "); println(f8(4) == (4 / 7)) print("f9 = "); println(f9(4) == (4 % 7)) - + print("f10 = "); println(f10(4) == (4 | 7)) print("f11 = "); println(f11(false) == (false | true)) print("f12 = "); println(f12(4) == (4 ^ 7)) @@ -61,11 +61,11 @@ object Test extends App { print("f15 = "); println(f15(false) == (false & true)) print("f16 = "); println(f16(false) == (false || true)) print("f17 = "); println(f17(false) == (false && true)) - + print("f18 = "); println(f18(4) == (4 << 7)) print("f19 = "); println(f19(-4) == (-4 >> 7)) print("f20 = "); println(f20(-4) == (-4 >>> 7)) - + print("f21 = "); println(f21(4.2) == (4.2.toByte)) print("f22 = "); println(f22(4.2) == (4.2.toShort)) print("f23 = "); println(f23(4.2) == (4.2.toChar)) @@ -73,17 +73,17 @@ object Test extends App { print("f25 = "); println(f25(4.2) == (4.2.toLong)) print("f26 = "); println(f26(4.2) == (4.2.toFloat)) print("f27 = "); println(f27(4.2) == (4.2.toDouble)) - + print("f28 = "); println(f28(4) == (4 == 7)) print("f29 = "); println(f29(4) == (4 != 7)) print("f30 = "); println(f30(false) == (false == true)) print("f31 = "); println(f31(false) == (false != true)) - + print("f32 = "); println(f32(4) == (4 < 7)) print("f33 = "); println(f33(4) == (4 <= 7)) print("f34 = "); println(f34(4) == (4 >= 7)) print("f35 = "); println(f35(4) == (4 > 7)) - + println("ok") - + } diff --git a/test/files/run/iterator3444.scala b/test/files/run/iterator3444.scala index 1d0713addc..2d0643bd56 100644 --- a/test/files/run/iterator3444.scala +++ b/test/files/run/iterator3444.scala @@ -2,22 +2,22 @@ // ticked #3444 object Test { - + def main(args: Array[String]) { val it = (1 to 12).toSeq.iterator - + assert(it.next == 1) assert(it.take(2).toList == List(2, 3)) - + val jt = (4 to 12).toSeq.iterator assert(jt.next == 4) assert(jt.drop(5).toList == List(10, 11, 12)) - + val kt = (1 until 10).toSeq.iterator assert(kt.drop(50).toList == Nil) - + val mt = (1 until 5).toSeq.iterator assert(mt.take(50).toList == List(1, 2, 3, 4)) } - + } diff --git a/test/files/run/iterators.scala b/test/files/run/iterators.scala index 60eccdc8cc..b85291cd72 100644 --- a/test/files/run/iterators.scala +++ b/test/files/run/iterators.scala @@ -82,16 +82,16 @@ object Test { var xs4 = a.slice(0, 4).iterator.toList; xs0.length + xs1.length + xs2.length + xs3.length + xs4.length } - + def check_toSeq: String = List(1, 2, 3, 4, 5).iterator.toSeq.mkString("x") - + def check_indexOf: String = { val i = List(1, 2, 3, 4, 5).indexOf(4) val j = List(1, 2, 3, 4, 5).indexOf(16) "" + i + "x" + j } - + def check_findIndexOf: String = { val i = List(1, 2, 3, 4, 5).indexWhere { x: Int => x >= 4 } val j = List(1, 2, 3, 4, 5).indexWhere { x: Int => x >= 16 } diff --git a/test/files/run/java-erasure.scala b/test/files/run/java-erasure.scala index c9f9b0ad51..0441ad705b 100644 --- a/test/files/run/java-erasure.scala +++ b/test/files/run/java-erasure.scala @@ -3,7 +3,7 @@ object Test { list add "a" list add "c" list add "b" - + def main(args: Array[String]): Unit = { println(java.util.Collections.max(list)) } diff --git a/test/files/run/json.scala b/test/files/run/json.scala index 8ee8c347fd..7d3b635006 100644 --- a/test/files/run/json.scala +++ b/test/files/run/json.scala @@ -34,7 +34,7 @@ object Test extends App { case Some(parsed) => println("Passed parse : " + sortJSON(parsed)) } } - + // For this usage, do a raw parse (to JSONObject/JSONArray) def printJSON(given : String, expected : JSONType) { printJSON(given, JSON.parseRaw, expected) @@ -89,11 +89,11 @@ object Test extends App { // The library should recurse into arrays to find objects (ticket #2207) printJSON("[{\"a\" : \"team\"},{\"b\" : 52}]", JSONArray(List(JSONObject(Map("a" -> "team")), JSONObject(Map("b" -> 52.0))))) - + // The library should differentiate between empty maps and lists (ticket #3284) - printJSONFull("{}", Map()) + printJSONFull("{}", Map()) printJSONFull("[]", List()) - + // Lists should be returned in the same order as specified printJSON("[4,1,3,2,6,5,8,7]", JSONArray(List[Double](4,1,3,2,6,5,8,7))) @@ -152,7 +152,7 @@ object Test extends App { ) ) - + printJSONFull(sample1, sample1Obj) println @@ -188,7 +188,7 @@ object Test extends App { // from http://json.org/example.html val sample3 = """ {"web-app": { - "servlet": [ + "servlet": [ { "servlet-name": "cofaxCDS", "servlet-class": "org.cofax.cds.CDSServlet", @@ -244,7 +244,7 @@ object Test extends App { { "servlet-name": "cofaxAdmin", "servlet-class": "org.cofax.cds.AdminServlet"}, - + { "servlet-name": "fileServlet", "servlet-class": "org.cofax.cds.FileServlet"}, @@ -271,7 +271,7 @@ object Test extends App { "cofaxAdmin": "/admin/*", "fileServlet": "/static/*", "cofaxTools": "/tools/*"}, - + "taglib": { "taglib-uri": "cofax.tld", "taglib-location": "/WEB-INF/tlds/cofax.tld"} diff --git a/test/files/run/kmpSliceSearch.scala b/test/files/run/kmpSliceSearch.scala index e72f78bfed..0f7e052d5f 100644 --- a/test/files/run/kmpSliceSearch.scala +++ b/test/files/run/kmpSliceSearch.scala @@ -12,7 +12,7 @@ object Test { } def main(args: Array[String]) { val rng = new scala.util.Random(java.lang.Integer.parseInt("kmp",36)) - + // Make sure we agree with naive implementation for (h <- Array(2,5,1000)) { for (i <- 0 to 100) { @@ -38,7 +38,7 @@ object Test { } } } - + // Check performance^Wcorrectness of common small test cases val haystacks = List[Seq[Int]]( Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), @@ -52,8 +52,8 @@ object Test { List(1,1,1,1,1,2), 5 to 9 ) - (haystacks zip needles) foreach { - case (hay, nee) => + (haystacks zip needles) foreach { + case (hay, nee) => println(hay.indexOfSlice(nee,2) + " " + hay.lastIndexOfSlice(nee,13)) } } diff --git a/test/files/run/lazy-exprs.scala b/test/files/run/lazy-exprs.scala index 204c4b564b..fc724bd10b 100644 --- a/test/files/run/lazy-exprs.scala +++ b/test/files/run/lazy-exprs.scala @@ -2,7 +2,7 @@ object TestExpressions { def patmatchScrut { lazy val z1: Option[String] = { println("forced "); Some("lazy z1") } - + val res = z1 match { case Some(msg) => msg case None => "failed" @@ -17,10 +17,10 @@ object TestExpressions { def patmatchCase { val t: Option[String] = Some("test") val res = t match { - case Some(msg) => + case Some(msg) => lazy val z1 = { println("forced "); "lazy z1" } z1 - + case None => "failed" } print("lazy val in case: ") @@ -36,9 +36,9 @@ object TestExpressions { print("lazy val in case: ") val t: Option[String] = Some("lazy Z1") t match { - case Some(Z1) => + case Some(Z1) => println("ok") - + case None => println("failed") } @@ -60,13 +60,13 @@ object TestExpressions { print("lazy val in pattern: ") val t: Option[String] = Some("LazyField") t match { - case Some(LazyField) => + case Some(LazyField) => println("ok") - + case None => println("failed") } - } + } lazy val (x, y) = ({print("x"); "x"}, {print("y"); "y"}) def testPatLazyVal { diff --git a/test/files/run/lazy-locals.scala b/test/files/run/lazy-locals.scala index ba555daf95..696aeeba96 100644 --- a/test/files/run/lazy-locals.scala +++ b/test/files/run/lazy-locals.scala @@ -163,18 +163,18 @@ object Test extends App { // see #1589 object NestedLazyVals { - lazy val x = { + lazy val x = { lazy val y = { println("forcing y"); 42; } println("forcing x") - y + y } - + val x1 = 5 + { lazy val y = 10 ; y } - + println(x) println(x1) } - + trait TNestedLazyVals { lazy val x = { lazy val y = 42; y } } diff --git a/test/files/run/lazy-override-run.scala b/test/files/run/lazy-override-run.scala index 6016c3c8be..d197408775 100644 --- a/test/files/run/lazy-override-run.scala +++ b/test/files/run/lazy-override-run.scala @@ -20,7 +20,7 @@ object Test extends App { val b = new B print("b.x=") - println(b.x) + println(b.x) print("b.z=") - println(b.z) + println(b.z) } diff --git a/test/files/run/lazy-traits.scala b/test/files/run/lazy-traits.scala index 38207672db..f04c0b8b1f 100644 --- a/test/files/run/lazy-traits.scala +++ b/test/files/run/lazy-traits.scala @@ -1,5 +1,5 @@ trait A { - lazy val z1 = { + lazy val z1 = { println("") "lazy z1" } @@ -7,7 +7,7 @@ trait A { /** Simple class which mixes in one lazy val. */ class Cls extends AnyRef with A { - override def toString = + override def toString = "z1 = " + z1 } @@ -18,7 +18,7 @@ class Cls2 extends AnyRef with A { "lazy z2" } - override def toString = + override def toString = "z1 = " + z1 + " z2 = " + z2 } @@ -34,7 +34,7 @@ class ClsB extends Object with B { println("") "lazy zc1" } - override def toString = + override def toString = "z1 = " + z1 + " zb1 = " + zb1 + " zc1 = " + zc1 } @@ -73,39 +73,39 @@ class OverflownLazyFields extends Object with A { lazy val zc30 = { println(""); "lazy zc30" } lazy val zc31 = { println(""); "lazy zc31" } - override def toString = - "\nzc00 = " + zc00 + - "\nzc01 = " + zc01 + - "\nzc02 = " + zc02 + - "\nzc03 = " + zc03 + - "\nzc04 = " + zc04 + - "\nzc05 = " + zc05 + - "\nzc06 = " + zc06 + - "\nzc07 = " + zc07 + - "\nzc08 = " + zc08 + - "\nzc09 = " + zc09 + - "\nzc10 = " + zc10 + - "\nzc11 = " + zc11 + - "\nzc12 = " + zc12 + - "\nzc13 = " + zc13 + - "\nzc14 = " + zc14 + - "\nzc15 = " + zc15 + - "\nzc16 = " + zc16 + - "\nzc17 = " + zc17 + - "\nzc18 = " + zc18 + - "\nzc19 = " + zc19 + - "\nzc20 = " + zc20 + - "\nzc21 = " + zc21 + - "\nzc22 = " + zc22 + - "\nzc23 = " + zc23 + - "\nzc24 = " + zc24 + - "\nzc25 = " + zc25 + - "\nzc26 = " + zc26 + - "\nzc27 = " + zc27 + - "\nzc28 = " + zc28 + - "\nzc29 = " + zc29 + - "\nzc30 = " + zc30 + - "\nzc31 = " + zc31 + + override def toString = + "\nzc00 = " + zc00 + + "\nzc01 = " + zc01 + + "\nzc02 = " + zc02 + + "\nzc03 = " + zc03 + + "\nzc04 = " + zc04 + + "\nzc05 = " + zc05 + + "\nzc06 = " + zc06 + + "\nzc07 = " + zc07 + + "\nzc08 = " + zc08 + + "\nzc09 = " + zc09 + + "\nzc10 = " + zc10 + + "\nzc11 = " + zc11 + + "\nzc12 = " + zc12 + + "\nzc13 = " + zc13 + + "\nzc14 = " + zc14 + + "\nzc15 = " + zc15 + + "\nzc16 = " + zc16 + + "\nzc17 = " + zc17 + + "\nzc18 = " + zc18 + + "\nzc19 = " + zc19 + + "\nzc20 = " + zc20 + + "\nzc21 = " + zc21 + + "\nzc22 = " + zc22 + + "\nzc23 = " + zc23 + + "\nzc24 = " + zc24 + + "\nzc25 = " + zc25 + + "\nzc26 = " + zc26 + + "\nzc27 = " + zc27 + + "\nzc28 = " + zc28 + + "\nzc29 = " + zc29 + + "\nzc30 = " + zc30 + + "\nzc31 = " + zc31 + "\nz1 = " + z1 } diff --git a/test/files/run/lift-and-unlift.scala b/test/files/run/lift-and-unlift.scala index 5a59f63ae4..b944c70155 100644 --- a/test/files/run/lift-and-unlift.scala +++ b/test/files/run/lift-and-unlift.scala @@ -5,21 +5,21 @@ object Test { def evens2: PartialFunction[Int, Int] = { case x if x % 2 == 0 => x } - + def main(args: Array[String]): Unit = { val f1 = evens1 _ val f2 = evens2.lift - + assert(1 to 10 forall (x => f1(x) == f2(x))) - + val f3 = unlift(f1) val f4 = unlift(f2) - + assert(1 to 10 forall { x => if (!f3.isDefinedAt(x)) !f4.isDefinedAt(x) else f3(x) == f4(x) }) - + assert(f1 eq f3.lift) // Hmm, why is this not true: // assert(f2 eq f4.lift) diff --git a/test/files/run/lists-run.scala b/test/files/run/lists-run.scala index 13fca22982..ccfe5bc260 100644 --- a/test/files/run/lists-run.scala +++ b/test/files/run/lists-run.scala @@ -4,7 +4,7 @@ */ object Test { def main(args: Array[String]) { - Test_multiset.run() // multiset operations: union, intersect, diff + Test_multiset.run() // multiset operations: union, intersect, diff Test1.run() //count, exists, filter, .. Test2.run() //#468 Test3.run() //#1691 @@ -54,7 +54,7 @@ object Test_multiset { assert(List(3, 2) == (vs diff xs), "vs_diff_xs") assert(isSubListOf(xs filterNot (vs contains), xs diff vs), "xs_subset_vs") - // tests adapted from Thomas Jung + // tests adapted from Thomas Jung assert({ def sort(zs: List[Int]) = zs sortWith ( _ > _ ) sort(xs intersect ys) == sort(ys intersect xs) @@ -62,7 +62,7 @@ object Test_multiset { assert({ def cardinality[A](zs: List[A], e: A): Int = zs count (e == _) val intersection = xs intersect ys - xs forall (e => cardinality(intersection, e) == (cardinality(xs, e) + xs forall (e => cardinality(intersection, e) == (cardinality(xs, e) min cardinality(ys, e))) }, "obey min cardinality") assert({ @@ -133,7 +133,7 @@ object Test2 { def run() { val xs1 = List(1, 2, 3) val xs2 = List(0) - + val ys1 = xs1 ::: List(4) assert(List(1, 2, 3, 4) == ys1, "check_:::") diff --git a/test/files/run/manifests.scala b/test/files/run/manifests.scala index ed6efab70d..1da06b8aee 100644 --- a/test/files/run/manifests.scala +++ b/test/files/run/manifests.scala @@ -4,15 +4,15 @@ object Test val CO, IN, CONTRA = Value } import Variances.{ CO, IN, CONTRA } - + object SubtypeRelationship extends Enumeration { val NONE, SAME, SUB, SUPER = Value } import SubtypeRelationship.{ NONE, SAME, SUB, SUPER } - + class VarianceTester[T, U, CC[_]](expected: Variances.Value)( implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) { - + def elements = List(ev1 <:< ev2, ev2 <:< ev1) def containers = List(ev3 <:< ev4, ev4 <:< ev3) @@ -20,13 +20,13 @@ object Test def isSame = typeCompare[T, U] == SAME def isSub = typeCompare[T, U] == SUB def isSuper = typeCompare[T, U] == SUPER - + def showsCovariance = (elements == containers) def showsContravariance = (elements == containers.reverse) def showsInvariance = containers forall (_ == isSame) def allContainerVariances = List(showsCovariance, showsInvariance, showsContravariance) - + def showsExpectedVariance = if (isUnrelated) allContainerVariances forall (_ == false) else if (isSame) allContainerVariances forall (_ == true) @@ -36,55 +36,55 @@ object Test case CONTRA => showsContravariance && !showsCovariance && !showsInvariance } } - + def showsCovariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) = new VarianceTester[T, U, CC](CO) showsExpectedVariance def showsInvariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) = new VarianceTester[T, U, CC](IN) showsExpectedVariance - + def showsContravariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) = new VarianceTester[T, U, CC](CONTRA) showsExpectedVariance - + def typeCompare[T, U](implicit ev1: Manifest[T], ev2: Manifest[U]) = (ev1 <:< ev2, ev2 <:< ev1) match { case (true, true) => SAME case (true, false) => SUB case (false, true) => SUPER case (false, false) => NONE } - + def assertAnyRef[T: Manifest] = List( manifest[T] <:< manifest[Any], manifest[T] <:< manifest[AnyRef], !(manifest[T] <:< manifest[AnyVal]) ) foreach (assert(_, "assertAnyRef")) - + def assertAnyVal[T: Manifest] = List( manifest[T] <:< manifest[Any], !(manifest[T] <:< manifest[AnyRef]), manifest[T] <:< manifest[AnyVal] ) foreach (assert(_, "assertAnyVal")) - + def assertSameType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SAME, "assertSameType") def assertSuperType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SUPER, "assertSuperType") def assertSubType[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == SUB, "assertSubType") def assertNoRelationship[T: Manifest, U: Manifest] = assert(typeCompare[T, U] == NONE, "assertNoRelationship") - + def testVariancesVia[T: Manifest, U: Manifest] = assert( - typeCompare[T, U] == SUB && + typeCompare[T, U] == SUB && showsCovariance[T, U, List] && showsInvariance[T, U, Set], "testVariancesVia" ) - + def runAllTests = { assertAnyVal[AnyVal] assertAnyVal[Unit] - assertAnyVal[Int] - assertAnyVal[Double] + assertAnyVal[Int] + assertAnyVal[Double] assertAnyVal[Boolean] assertAnyVal[Char] - + assertAnyRef[AnyRef] assertAnyRef[java.lang.Object] assertAnyRef[java.lang.Integer] @@ -94,7 +94,7 @@ object Test assertAnyRef[String] assertAnyRef[scala.List[String]] assertAnyRef[scala.List[_]] - + // variance doesn't work yet // testVariancesVia[String, Any] // testVariancesVia[String, AnyRef] @@ -102,11 +102,11 @@ object Test assertSubType[List[String], List[Any]] assertSubType[List[String], List[AnyRef]] assertNoRelationship[List[String], List[AnyVal]] - + assertSubType[List[Int], List[Any]] assertSubType[List[Int], List[AnyVal]] assertNoRelationship[List[Int], List[AnyRef]] - + // Nothing assertSubType[Nothing, Any] assertSubType[Nothing, AnyVal] @@ -115,7 +115,7 @@ object Test assertSubType[Nothing, List[String]] assertSubType[Nothing, Null] assertSameType[Nothing, Nothing] - + // Null assertSubType[Null, Any] assertNoRelationship[Null, AnyVal] @@ -124,7 +124,7 @@ object Test assertSubType[Null, List[String]] assertSameType[Null, Null] assertSuperType[Null, Nothing] - + // Any assertSameType[Any, Any] assertSuperType[Any, AnyVal] @@ -133,7 +133,7 @@ object Test assertSuperType[Any, List[String]] assertSuperType[Any, Null] assertSuperType[Any, Nothing] - + // Misc unrelated types assertNoRelationship[Unit, AnyRef] assertNoRelationship[Unit, Int] diff --git a/test/files/run/mapConserve.scala b/test/files/run/mapConserve.scala index a285113b11..013095b1de 100644 --- a/test/files/run/mapConserve.scala +++ b/test/files/run/mapConserve.scala @@ -4,8 +4,8 @@ import scala.collection.mutable.ListBuffer object Test { val maxListLength = 7 // up to 16, but larger is slower var testCount = 0 - - def checkStackOverflow() = { + + def checkStackOverflow() = { var xs: List[String] = Nil for (i <- 0 until 250000) xs = "X" :: xs @@ -47,7 +47,7 @@ object Test { // Behaves like existing mapConserve with respect to eq checkBehaviourUnchanged(data, data mapConserve lastHexDigit, data mapConserve lastHexDigit) } - + checkStackOverflow(); } } \ No newline at end of file diff --git a/test/files/run/mapValues.scala b/test/files/run/mapValues.scala index d3266bd18f..bd1794bc51 100644 --- a/test/files/run/mapValues.scala +++ b/test/files/run/mapValues.scala @@ -1,7 +1,7 @@ object Test { val m = Map(1 -> 1, 2 -> 2) val mv = (m mapValues identity) - 1 - + def main(args: Array[String]): Unit = { assert(mv.size == 1) } diff --git a/test/files/run/map_java_conversions.scala b/test/files/run/map_java_conversions.scala index a41fae3695..7714b2cc74 100644 --- a/test/files/run/map_java_conversions.scala +++ b/test/files/run/map_java_conversions.scala @@ -4,20 +4,20 @@ object Test { - + def main(args: Array[String]) { import collection.JavaConversions._ - + test(new java.util.HashMap[String, String]) test(new java.util.Properties) testConcMap } - + def testConcMap { import collection.JavaConversions._ - + val concMap = new java.util.concurrent.ConcurrentHashMap[String, String] - + test(concMap) val cmap = asScalaConcurrentMap(concMap) cmap.putIfAbsent("absentKey", "absentValue") @@ -26,31 +26,31 @@ object Test { assert(cmap.replace("absentKey", "newAbsentValue") == Some("absentValue")) assert(cmap.replace("absentKey", "newAbsentValue", ".......") == true) } - + def test(m: collection.mutable.Map[String, String]) { m.clear assert(m.size == 0) - + m.put("key", "value") assert(m.size == 1) - + assert(m.put("key", "anotherValue") == Some("value")) assert(m.put("key2", "value2") == None) assert(m.size == 2) - + m += (("key3", "value3")) assert(m.size == 3) - + m -= "key2" assert(m.size == 2) assert(m.nonEmpty) assert(m.remove("key") == Some("anotherValue")) - + m.clear for (i <- 0 until 10) m += (("key" + i, "value" + i)) for ((k, v) <- m) assert(k.startsWith("key")) } - + } diff --git a/test/files/run/matchbytes.scala b/test/files/run/matchbytes.scala index f2cea06eb3..7190886bab 100644 --- a/test/files/run/matchbytes.scala +++ b/test/files/run/matchbytes.scala @@ -4,4 +4,4 @@ object Test extends App{ case 1 => println(1); case _ => println("????"); } -} +} diff --git a/test/files/run/matchintasany.scala b/test/files/run/matchintasany.scala index 03f6ca2a84..c6764b31b9 100644 --- a/test/files/run/matchintasany.scala +++ b/test/files/run/matchintasany.scala @@ -5,4 +5,4 @@ object Test extends App{ case 1L => println(1); case _ => println("????"); } -} +} diff --git a/test/files/run/matchnull.scala b/test/files/run/matchnull.scala index 2cc8550d47..cfb3049239 100644 --- a/test/files/run/matchnull.scala +++ b/test/files/run/matchnull.scala @@ -3,7 +3,7 @@ object Test def f1 = null match { case x: AnyRef => 1 case _ => -1 } def f2(x: Any) = x match { case 52 => 1 ; case null => -1 ; case _ => 0 } def f3(x: AnyRef) = x match { case x: String => 1 ; case List(_) => 0 ; case null => -1 ; case _ => -2 } - + def main(args: Array[String]): Unit = { println(f1) println(f2(null)) diff --git a/test/files/run/misc.scala b/test/files/run/misc.scala index 2ae76bd968..139d2d70f7 100644 --- a/test/files/run/misc.scala +++ b/test/files/run/misc.scala @@ -60,7 +60,7 @@ object Test { Console.println; val x = 13; x; - // !!! why are DefDef replaced by Block(Tree[0])? we should use Empty! + // !!! why are DefDef replaced by Block(Tree[0])? we should use Empty! def f = 19; f; def f0() = 11; diff --git a/test/files/run/missingparams.scala b/test/files/run/missingparams.scala index fbc4d2a4f7..e9b1d27d68 100644 --- a/test/files/run/missingparams.scala +++ b/test/files/run/missingparams.scala @@ -6,8 +6,8 @@ final class Foo(val x: Int) { // test that the closure elimination is not wrongly replacing // 'that' by 'this' - def intersect(that: Foo) = - filter { dummy => + def intersect(that: Foo) = + filter { dummy => // x // dummy that.x > 0 } diff --git a/test/files/run/mock.scala b/test/files/run/mock.scala index e414e51e2d..8778e20ef5 100644 --- a/test/files/run/mock.scala +++ b/test/files/run/mock.scala @@ -5,11 +5,11 @@ import java.io.Closeable object Test { // It'd be really nice about now if functions had a common parent. implicit def interfaceify(x: AnyRef): UniversalFn = UniversalFn(x) - + def runner(x: Runnable) = x.run() def caller[T](x: Callable[T]): T = x.call() def closer(x: Closeable) = x.close() - + def main(args: Array[String]): Unit = { var counter = 0 val closure = () => { @@ -21,7 +21,7 @@ object Test { val int1 = closure.as[Runnable] val int2 = closure.as[Callable[Int]] val int3 = closure.as[Closeable] - + runner(int1) caller(int2) closer(int3) diff --git a/test/files/run/nodebuffer-array.scala b/test/files/run/nodebuffer-array.scala index f9cfbc50df..4e1ffe1e5e 100644 --- a/test/files/run/nodebuffer-array.scala +++ b/test/files/run/nodebuffer-array.scala @@ -1,5 +1,5 @@ object Test { - + def f(s: String) = { { @@ -8,7 +8,7 @@ object Test { } } - + def main(args: Array[String]): Unit = { println(f("a,b,c")) } diff --git a/test/files/run/null-and-intersect.scala b/test/files/run/null-and-intersect.scala index 7266dabe6d..1437fa4b25 100644 --- a/test/files/run/null-and-intersect.scala +++ b/test/files/run/null-and-intersect.scala @@ -2,7 +2,7 @@ object Test { trait Immortal class Bippy extends Immutable with Immortal class Boppy extends Immutable - + def f[T](x: Traversable[T]) = x match { case _: Map[_, _] => 3 case _: Seq[_] => 2 @@ -23,10 +23,10 @@ object Test { println(f(Seq(1))) println(f(Map(1 -> 2))) println(f(null)) - + println(g(new Bippy)) println(g(null)) - + println(h(new Bippy)) println(h(new Boppy)) println(h(null)) diff --git a/test/files/run/null-hash.scala b/test/files/run/null-hash.scala index 9b1f28b083..abf15e8166 100644 --- a/test/files/run/null-hash.scala +++ b/test/files/run/null-hash.scala @@ -2,7 +2,7 @@ object Test { def f1 = List(5, 10, null: String).## def f2(x: Any) = x.## def f3 = ((55, "abc", null: List[Int])).## - + def main(args: Array[String]): Unit = { f1 f2(null) diff --git a/test/files/run/number-parsing.scala b/test/files/run/number-parsing.scala index ad1481063e..21551a3a07 100644 --- a/test/files/run/number-parsing.scala +++ b/test/files/run/number-parsing.scala @@ -2,12 +2,12 @@ object Test { def numTests() = { val MinusZero = Float.box(-0.0f) val PlusZero = Float.box(0.0f) - + assert(PlusZero match { case MinusZero => false ; case _ => true }) assert(MinusZero match { case PlusZero => false ; case _ => true }) assert((MinusZero: scala.Float) == (PlusZero: scala.Float)) assert(!(MinusZero equals PlusZero)) - + List( -5f.max(2) , -5f max 2 , diff --git a/test/files/run/numbereq.scala b/test/files/run/numbereq.scala index b07c83dc3e..77a217df36 100644 --- a/test/files/run/numbereq.scala +++ b/test/files/run/numbereq.scala @@ -13,25 +13,25 @@ object Test { if (x >= Byte.MinValue && x <= Byte.MaxValue) List(new java.lang.Byte(x.toByte)) else Nil, if (x >= Char.MinValue && x <= Char.MaxValue) List(new java.lang.Character(x.toChar)) else Nil ).flatten - + base ::: extras } - - + + def main(args: Array[String]): Unit = { val ints = (0 to 15).toList map (Short.MinValue >> _) val ints2 = ints map (x => -x) val ints3 = ints map (_ + 1) val ints4 = ints2 map (_ - 1) - + val setneg1 = ints map mkNumbers val setneg2 = ints3 map mkNumbers val setpos1 = ints2 map mkNumbers val setpos2 = ints4 map mkNumbers val zero = mkNumbers(0) - - val sets = setneg1 ++ setneg2 ++ List(zero) ++ setpos1 ++ setpos2 - + + val sets = setneg1 ++ setneg2 ++ List(zero) ++ setpos1 ++ setpos2 + for (set <- sets ; x <- set ; y <- set) { // println("'%s' == '%s' (%s == %s) (%s == %s)".format(x, y, x.hashCode, y.hashCode, x.##, y.##)) assert(x == y, "%s/%s != %s/%s".format(x, x.getClass, y, y.getClass)) diff --git a/test/files/run/origins.scala b/test/files/run/origins.scala index 4c98e7a66c..ab873bca89 100644 --- a/test/files/run/origins.scala +++ b/test/files/run/origins.scala @@ -14,7 +14,7 @@ object Test { def f1() = 1 to 5 map boop def f2() = 1 to 10 map boop def f3() = 1 to 50 map boop - + def main(args: Array[String]): Unit = { f1() ; f2() ; f3() } diff --git a/test/files/run/packrat1.scala b/test/files/run/packrat1.scala index 31a1ea55e5..b5a4687378 100644 --- a/test/files/run/packrat1.scala +++ b/test/files/run/packrat1.scala @@ -21,15 +21,15 @@ object Test extends App{ } object grammars extends StandardTokenParsers with PackratParsers{ - + def extractResult(r : ParseResult[_]) = r match { case Success(a,_) => a case NoSuccess(a,_) => a } - + lexical.delimiters ++= List("+","-","*","/","(",")") lexical.reserved ++= List("Hello","World") - + /**** * term = term + fact | term - fact | fact * fact = fact * num | fact / num | num @@ -39,7 +39,7 @@ object grammars extends StandardTokenParsers with PackratParsers{ val term: PackratParser[Int] = (term~("+"~>fact) ^^ {case x~y => x+y} |term~("-"~>fact) ^^ {case x~y => x-y} |fact) - + val fact: PackratParser[Int] = (fact~("*"~>numericLit) ^^ {case x~y => x*y.toInt} |fact~("/"~>numericLit) ^^ {case x~y => x/y.toInt} |"("~>term<~")" diff --git a/test/files/run/packrat2.scala b/test/files/run/packrat2.scala index b91a2eae46..f55021a6a8 100644 --- a/test/files/run/packrat2.scala +++ b/test/files/run/packrat2.scala @@ -22,15 +22,15 @@ object Test extends App{ } object grammars2 extends StandardTokenParsers with PackratParsers{ - + def extractResult(r : ParseResult[_]) = r match{ case Success(a,_) => a case NoSuccess(a,_) => a } - + lexical.delimiters ++= List("+","-","*","/","(",")") lexical.reserved ++= List("Hello","World") - + /* * exp = sum | prod | num * sum = exp ~ "+" ~ num @@ -40,18 +40,18 @@ object grammars2 extends StandardTokenParsers with PackratParsers{ val exp : PackratParser[Int] = sum | prod | numericLit ^^{_.toInt} | "("~>exp<~")" val sum : PackratParser[Int] = exp~("+"~>exp) ^^ {case x~y => x+y} val prod: PackratParser[Int] = exp~("*"~>(numericLit ^^{_.toInt} | exp)) ^^ {case x~y => x*y} - - + + /* lexical.reserved ++= List("a","b", "c") val a : PackratParser[Any] = numericLit^^{x => primeFactors(x.toInt)} val b : PackratParser[Any] = memo("b") val c : PackratParser[Any] = memo("c") - val AnBnCn : PackratParser[Any] = + val AnBnCn : PackratParser[Any] = parseButDontEat(repMany1(a,b))~not(b)~>rep1(a)~repMany1(b,c)// ^^{case x~y => x:::y} //val c : PackratParser[Any] = parseButDontEat(a)~a~a //println(c((new PackratReader(new lexical.Scanner("45 24"))))) val r = new PackratReader(new lexical.Scanner("45 b c")) println(AnBnCn(r)) println(r.getCache.size) -*/ +*/ } diff --git a/test/files/run/packrat3.scala b/test/files/run/packrat3.scala index 8eab8ec6d0..216ef8f0af 100644 --- a/test/files/run/packrat3.scala +++ b/test/files/run/packrat3.scala @@ -24,28 +24,28 @@ object Test { } object grammars3 extends StandardTokenParsers with PackratParsers { - + def extractResult(r: ParseResult[_]) = r match { case Success(a,_) => a case NoSuccess(a,_) => a } - + lexical.reserved ++= List("a","b", "c") val a: PackratParser[Any] = memo("a") val b: PackratParser[Any] = memo("b") val c: PackratParser[Any] = memo("c") - val AnBnCn: PackratParser[Any] = + val AnBnCn: PackratParser[Any] = guard(repMany1(a,b) ~ not(b)) ~ rep1(a) ~ repMany1(b,c)// ^^{case x~y => x:::y} - private def repMany[T](p: => Parser[T], q: => Parser[T]): Parser[List[T]] = + private def repMany[T](p: => Parser[T], q: => Parser[T]): Parser[List[T]] = ( p~repMany(p,q)~q ^^ {case x~xs~y => x::xs:::(y::Nil)} | success(Nil) ) - def repMany1[T](p: => Parser[T], q: => Parser[T]): Parser[List[T]] = + def repMany1[T](p: => Parser[T], q: => Parser[T]): Parser[List[T]] = p~opt(repMany(p,q))~q ^^ {case x~Some(xs)~y => x::xs:::(y::Nil)} -} +} diff --git a/test/files/run/parmap-ops.scala b/test/files/run/parmap-ops.scala index 01972174f6..31828d9522 100644 --- a/test/files/run/parmap-ops.scala +++ b/test/files/run/parmap-ops.scala @@ -5,10 +5,10 @@ import collection._ object Test { - + def main(args: Array[String]) { val gm: GenMap[Int, Int] = GenMap(0 -> 0, 1 -> 1).par - + // ops assert(gm.isDefinedAt(1)) assert(gm.contains(1)) @@ -25,11 +25,11 @@ object Test { } catch { case e: NoSuchElementException => // ok } - + assert(gm.filterKeys(_ % 2 == 0)(0) == 0) assert(gm.filterKeys(_ % 2 == 0).get(1) == None) assert(gm.mapValues(_ + 1)(0) == 1) - + // with defaults val pm = parallel.mutable.ParMap(0 -> 0, 1 -> 1) val dm = pm.withDefault(x => -x) @@ -41,12 +41,12 @@ object Test { assert(dm(3) == 3) assert(pm(3) == 3) assert(dm(4) == -4) - + val imdm = parallel.immutable.ParMap(0 -> 0, 1 -> 1).withDefault(x => -x) assert(imdm(0) == 0) assert(imdm(1) == 1) assert(imdm(2) == -2) assert(imdm.updated(2, 2) == parallel.ParMap(0 -> 0, 1 -> 1, 2 -> 2)) } - + } diff --git a/test/files/run/patch-boundary.scala b/test/files/run/patch-boundary.scala index ed1a0e9fc1..8381956859 100644 --- a/test/files/run/patch-boundary.scala +++ b/test/files/run/patch-boundary.scala @@ -1,8 +1,8 @@ object Test { def f = collection.mutable.ArrayBuffer(1, 2, 3, 4, 5, 6, 7, 8) def g = f.patch(4, List(1, 2), 10) - + def main(args: Array[String]): Unit = { - assert(g.size == 6) + assert(g.size == 6) } } diff --git a/test/files/run/patmat-exprs.scala b/test/files/run/patmat-exprs.scala index f502a14832..dfc78e2ca5 100644 --- a/test/files/run/patmat-exprs.scala +++ b/test/files/run/patmat-exprs.scala @@ -37,7 +37,7 @@ trait Pattern { // // type Numeric[T] // import java.io.Serializable - // + // // implicit def compat27a[T](x: Iterable[T]) = new { // def iterator: Iterator[T] = x.elements // def sum: Int = 5 @@ -278,8 +278,8 @@ trait Pattern { case Mul(Mul(y, Const(z)), Const(x)) => Mul(const(num.mul(x, z)), y) case Const(x) if x == num.one => One[T] - case Const(x) if x == num.zero => Zero[T] - + case Const(x) if x == num.zero => Zero[T] + case Sub(x, Neg(y)) => Add(List(x, y)) case Sub(Neg(x), y) => Neg(Add(List(x, y))) case Neg(Neg(x)) => x diff --git a/test/files/run/patmat-seqs.scala b/test/files/run/patmat-seqs.scala index b5c47b4b4b..e23711697c 100644 --- a/test/files/run/patmat-seqs.scala +++ b/test/files/run/patmat-seqs.scala @@ -7,14 +7,14 @@ object Test { case Seq(_, _, _, _, _, x: String) => "ss6" case _ => "d" } - + def f2(x: Any) = x match { case Seq("a", "b", _*) => "s2" case Seq(1, _*) => "s1" case Seq(5, 6, 7, _*) => "s3" case _ => "d" } - + def main(args: Array[String]): Unit = { val xs1 = List( List(1,2,3), @@ -24,9 +24,9 @@ object Test { Seq(1, 2, 3, 4, 5, "abcd"), "abc" ) map f1 - + xs1 foreach println - + val xs2 = List( Seq(5, 6, 7), Seq(5, 6, 7, 8, 9), @@ -36,7 +36,7 @@ object Test { Nil, 5 ) map f2 - + xs2 foreach println } } diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala index 9e91a48258..a6f8199457 100644 --- a/test/files/run/patmatnew.scala +++ b/test/files/run/patmatnew.scala @@ -251,7 +251,7 @@ object Test { } // (not regular) fancy guards / bug#644 - object TestSequence06 { + object TestSequence06 { case class A(i: Any) @@ -447,7 +447,7 @@ object Test { object Get extends Sync var ps: PartialFunction[Any, Any] = { - case Get(y) if y > 4 => // y gets a wildcard type for some reason?! hack + case Get(y) if y > 4 => // y gets a wildcard type for some reason?! hack } } def run() { diff --git a/test/files/run/pc-conversions.scala b/test/files/run/pc-conversions.scala index 6be0f99355..60ee59c3c4 100644 --- a/test/files/run/pc-conversions.scala +++ b/test/files/run/pc-conversions.scala @@ -5,11 +5,11 @@ import collection._ // test conversions between collections object Test { - + def main(args: Array[String]) { testConversions } - + def testConversions { // seq conversions assertSeq(parallel.mutable.ParArray(1, 2, 3)) @@ -18,7 +18,7 @@ object Test { assertSeq(parallel.immutable.ParRange(1, 50, 1, false)) assertSeq(parallel.immutable.ParHashMap(1 -> 2, 2 -> 4)) assertSeq(parallel.immutable.ParHashSet(1, 2, 3)) - + // par conversions assertPar(Array(1, 2, 3)) assertPar(mutable.ArrayBuffer(1, 2, 3)) @@ -29,7 +29,7 @@ object Test { assertPar(immutable.Range(1, 50, 1)) assertPar(immutable.HashMap(1 -> 1, 2 -> 2)) assertPar(immutable.HashSet(1, 2, 3)) - + // par.to* and to*.par tests assertToPar(List(1 -> 1, 2 -> 2, 3 -> 3)) assertToPar(Stream(1 -> 1, 2 -> 2)) @@ -47,19 +47,19 @@ object Test { assertToPar(parallel.mutable.ParHashSet(1 -> 2)) assertToPar(parallel.immutable.ParHashMap(1 -> 2)) assertToPar(parallel.immutable.ParHashSet(1 -> 3)) - + assertToParWoMap(immutable.Range(1, 10, 2)) - + // seq and par again conversions) assertSeqPar(parallel.mutable.ParArray(1, 2, 3)) } - + def assertSeqPar[T](pc: parallel.ParIterable[T]) = pc.seq.par == pc - + def assertSeq[T](pc: parallel.ParIterable[T]) = assert(pc.seq == pc) - + def assertPar[T, P <: Parallel](xs: GenIterable[T]) = assert(xs == xs.par) - + def assertToPar[K, V](xs: GenTraversable[(K, V)]) { xs match { case _: Seq[_] => @@ -67,26 +67,26 @@ object Test { assert(xs.par.toIterable == xs) case _ => } - + assert(xs.toSeq.par == xs.toSeq) assert(xs.par.toSeq == xs.toSeq) - + assert(xs.toSet.par == xs.toSet) assert(xs.par.toSet == xs.toSet) - + assert(xs.toMap.par == xs.toMap) assert(xs.par.toMap == xs.toMap) } - + def assertToParWoMap[T](xs: GenSeq[T]) { assert(xs.toIterable.par == xs.toIterable) assert(xs.par.toIterable == xs.toIterable) - + assert(xs.toSeq.par == xs.toSeq) assert(xs.par.toSeq == xs.toSeq) - + assert(xs.toSet.par == xs.toSet) assert(xs.par.toSet == xs.toSet) } - + } diff --git a/test/files/run/pf-catch.scala b/test/files/run/pf-catch.scala index f0b8baeeb3..ba0781fe89 100644 --- a/test/files/run/pf-catch.scala +++ b/test/files/run/pf-catch.scala @@ -6,12 +6,12 @@ object Test { case x: java.util.NoSuchElementException => shortName(x) case x: java.lang.IllegalArgumentException => shortName(x) } - + def fn[T: Handler](body: => T): T = { try body catch implicitly[Handler[T]] } - + def f1 = { implicit val myHandler = standardHandler println(fn(Nil.head)) @@ -28,7 +28,7 @@ object Test { def main(args: Array[String]): Unit = { try f1 catch { case x => println(shortName(x) + " slipped by.") } - + f2 } } diff --git a/test/files/run/primitive-sigs-2.scala b/test/files/run/primitive-sigs-2.scala index b17305a033..b7152f7e3d 100644 --- a/test/files/run/primitive-sigs-2.scala +++ b/test/files/run/primitive-sigs-2.scala @@ -25,7 +25,7 @@ object Test { val c1: Class[_] = classOf[T[_]] val c2: Class[_] = classOf[C] val c3: Class[_] = classOf[Arr] - + val c1m = c1.getMethods.toList filter (_.getName == "f") map (_.getGenericReturnType.toString) val c2m = c2.getMethods.toList filter (_.getName == "f") map (_.getGenericReturnType.toString) val c3m = c3.getDeclaredMethods.toList map (_.toGenericString) diff --git a/test/files/run/priorityQueue.scala b/test/files/run/priorityQueue.scala index 327d8bf137..edc0e32b02 100644 --- a/test/files/run/priorityQueue.scala +++ b/test/files/run/priorityQueue.scala @@ -31,23 +31,23 @@ object Test { // val pq2 = new PriorityQueue[String] // val pq3 = new PriorityQueue[String] // val pq4 = new PriorityQueue[String] - + // val strings = (1 to 20).toList map (i => List.fill((Math.abs(nextInt % 20)) + 1)("x").mkString) - + // pq1 ++= strings // pq2 ++= strings.reverse // for (s <- strings) pq3 += s // for (s <- strings.reverse) pq4 += s - + // val pqs = List(pq1, pq2, pq3, pq4, pq1.clone, pq2.clone) - + // for (queue1 <- pqs ; queue2 <- pqs) { // val l1: List[String] = queue1.dequeueAll[String, List[String]] // val l2: List[String] = queue2.dequeueAll[String, List[String]] // assert(l1 == l2) // assert(queue1.max == queue2.max) // } - + // assertPriorityDestructive(pq1) // } @@ -83,7 +83,7 @@ object Test { // } // for (i <- 0 until 100) assert(intpq(i) == (99 - i)) // } - + // def testTails { // val pq = new PriorityQueue[Int] // for (i <- 0 until 10) pq += i * 4321 % 200 @@ -108,13 +108,13 @@ object Test { // prev = curr // } // } - + // def testInits { // val pq = new PriorityQueue[Long] // for (i <- 0 until 20) pq += (i + 313) * 111 % 300 - + // assert(pq.size == 20) - + // val initpq = pq.init // assert(initpq.size == 19) // assertPriorityDestructive(initpq) @@ -123,19 +123,19 @@ object Test { // def testFilters { // val pq = new PriorityQueue[String] // for (i <- 0 until 100) pq += "Some " + (i * 312 % 200) - + // val filpq = pq.filter(_.indexOf('0') != -1) // assertPriorityDestructive(filpq) // } // def testIntensiveEnqueueDequeue { // val pq = new PriorityQueue[Int] - + // testIntensive(1000, pq) // pq.clear // testIntensive(200, pq) // } - + // def testIntensive(sz: Int, pq: PriorityQueue[Int]) { // val lst = new collection.mutable.ArrayBuffer[Int] ++ (0 until sz) // val rand = new util.Random(7) @@ -153,7 +153,7 @@ object Test { // pq ++= (0 until 100) // val droppq = pq.drop(50) // assertPriority(droppq) - + // pq.clear // pq ++= droppq // assertPriorityDestructive(droppq) @@ -173,7 +173,7 @@ object Test { // // assertPriority(pq) // // pq.clear - + // // pq ++= (1 to 100) // // pq(5) = 200 // // assert(pq(0) == 200) @@ -204,7 +204,7 @@ object Test { // def testEquality { // val pq1 = new PriorityQueue[Int] // val pq2 = new PriorityQueue[Int] - + // pq1 ++= (0 until 50) // var i = 49 // while (i >= 0) { @@ -213,7 +213,7 @@ object Test { // } // assert(pq1 == pq2) // assertPriority(pq2) - + // pq1 += 100 // assert(pq1 != pq2) // pq2 += 100 @@ -230,7 +230,7 @@ object Test { // val pq = new PriorityQueue[Int] // pq ++= (0 until 100) // assert(pq.size == 100) - + // val (p1, p2) = pq.partition(_ < 50) // assertPriorityDestructive(p1) // assertPriorityDestructive(p2) @@ -252,13 +252,13 @@ object Test { // assert(pq.lastIndexWhere(_ == 9) == 0) // assert(pq.lastIndexOf(8) == 1) // assert(pq.lastIndexOf(7) == 2) - + // pq += 5 // pq += 9 // assert(pq.lastIndexOf(9) == 1) // assert(pq.lastIndexWhere(_ % 2 == 1) == 10) // assert(pq.lastIndexOf(5) == 6) - + // val lst = pq.reverseIterator.toList // for (i <- 0 until 5) assert(lst(i) == i) // assert(lst(5) == 5) @@ -268,13 +268,13 @@ object Test { // assert(lst(9) == 8) // assert(lst(10) == 9) // assert(lst(11) == 9) - + // pq.clear // assert(pq.reverseIterator.toList.isEmpty) - + // pq ++= (50 to 75) // assert(pq.lastIndexOf(70) == 5) - + // pq += 55 // pq += 70 // assert(pq.lastIndexOf(70) == 6) @@ -284,11 +284,11 @@ object Test { // assert(pq.lastIndexWhere(_ > 54, 21) == 21) // assert(pq.lastIndexWhere(_ > 69, 5) == 5) // } - + // def testReverse { // val pq = new PriorityQueue[(Int, Int)] // pq ++= (for (i <- 0 until 10) yield (i, i * i % 10)) - + // assert(pq.reverse.size == pq.reverseIterator.toList.size) // assert((pq.reverse zip pq.reverseIterator.toList).forall(p => p._1 == p._2)) // assert(pq.reverse.sameElements(pq.reverseIterator.toSeq)) @@ -296,19 +296,19 @@ object Test { // assert(pq.reverse(1)._1 == pq(8)._1) // assert(pq.reverse(4)._1 == pq(5)._1) // assert(pq.reverse(9)._1 == pq(0)._1) - + // pq += ((7, 7)) // pq += ((7, 9)) // pq += ((7, 8)) // assert(pq.reverse.reverse == pq) // assert(pq.reverse.lastIndexWhere(_._2 == 6) == 6) // assertPriorityDestructive(pq.reverse.reverse) - + // val iq = new PriorityQueue[Int] // iq ++= (0 until 50) // assert(iq.reverse == iq.reverseIterator.toSeq) // assert(iq.reverse.reverse == iq) - + // iq += 25 // iq += 40 // iq += 10 @@ -317,10 +317,10 @@ object Test { // assert(iq.reverse.lastIndexWhere(_ == 10) == 11) // assertPriorityDestructive(iq.reverse.reverse) // } - + // def testToList { // val pq = new PriorityQueue[Int] - + // pq += 1 // pq += 4 // pq += 0 @@ -330,16 +330,16 @@ object Test { // assert(pq.toList == pq) // assert(pq == List(5, 4, 3, 2, 1, 0)) // assert(pq.reverse == List(0, 1, 2, 3, 4, 5)) - + // pq.clear // for (i <- -50 until 50) pq += i // assert(pq.toList == pq) // assert(pq.toList == (-50 until 50).reverse) // } - + // def testForeach { // val pq = new PriorityQueue[Char] - + // pq += 't' // pq += 'o' // pq += 'b' @@ -351,7 +351,7 @@ object Test { // assert(sbf.toString == sbi.toString) // assert(sbf.toString == "ytob") // } - + } diff --git a/test/files/run/private-inline.scala b/test/files/run/private-inline.scala index 5181ac8ba3..a45300b026 100644 --- a/test/files/run/private-inline.scala +++ b/test/files/run/private-inline.scala @@ -2,7 +2,7 @@ final class A { private var x1 = false var x2 = false - + // manipulates private var @inline private def wrapper1[T](body: => T): T = { val saved = x1 @@ -17,35 +17,35 @@ final class A { try body finally x2 = saved } - + // not inlined def f1a() = wrapper1(5) // inlined! def f1b() = identity(wrapper1(5)) - + // not inlined def f2a() = wrapper2(5) // inlined! - def f2b() = identity(wrapper2(5)) + def f2b() = identity(wrapper2(5)) } object Test { def methodClasses = List("f1a", "f1b", "f2a", "f2b") map ("A$$anonfun$" + _ + "$1") - + def main(args: Array[String]): Unit = { val a = new A import a._ println(f1a() + f1b() + f2a() + f2b()) - + // Don't know how else to test this: all these should have been // inlined, so all should fail. methodClasses foreach { clazz => - + val foundClass = ( try Class.forName(clazz) catch { case _ => null } ) - + assert(foundClass == null, foundClass) } } diff --git a/test/files/run/programmatic-main.scala b/test/files/run/programmatic-main.scala index 7fec0f3f98..7bc5c5dfcf 100644 --- a/test/files/run/programmatic-main.scala +++ b/test/files/run/programmatic-main.scala @@ -5,7 +5,7 @@ object Test { val cwd = Option(System.getProperty("partest.cwd")) getOrElse "." val basedir = Path(cwd).parent / "lib" path val baseargs = Array("-usejavacp", "-bootclasspath", basedir + "/scala-library.jar", "-cp", basedir + "/scala-compiler.jar") - + def main(args: Array[String]): Unit = { Console.withErr(Console.out) { Main process (baseargs ++ "-Xpluginsdir /does/not/exist/foo/quux -Xshow-phases".split(' ')) diff --git a/test/files/run/proxy.scala b/test/files/run/proxy.scala index 8a6385dc85..ea222cb496 100644 --- a/test/files/run/proxy.scala +++ b/test/files/run/proxy.scala @@ -1,16 +1,16 @@ object Test extends App { val p = new Proxy { - def self = 2 + def self = 2 } println(p equals 1) println(p equals 2) println(p equals 3) println(p equals null) - + case class Bippy(a: String) extends Proxy { def self = a } - + val label = Bippy("bippy!") println(label == label) println(label == "bippy!") diff --git a/test/files/run/range.scala b/test/files/run/range.scala index 2dc0bae330..f08b2105d3 100644 --- a/test/files/run/range.scala +++ b/test/files/run/range.scala @@ -6,7 +6,7 @@ object Test { range.foreach(buffer += _); assert(buffer.toList == range.iterator.toList, buffer.toList+"/"+range.iterator.toList) } - + def boundaryTests() = { // #4321 assert((Int.MinValue to Int.MaxValue by Int.MaxValue).size == 3) @@ -17,31 +17,31 @@ object Test { ) assert(caught) } - + case class GR[T](val x: T)(implicit val num: Integral[T]) { import num._ - + def negated = GR[T](-x) - + def gr1 = NumericRange(x, x, x) def gr2 = NumericRange.inclusive(x, x, x) def gr3 = NumericRange(x, x * fromInt(10), x) def gr4 = NumericRange.inclusive(x, x * fromInt(10), x) def gr5 = gr3.toList ::: negated.gr3.toList - + def check = { assert(gr1.isEmpty && !gr2.isEmpty) - assert(gr3.size == 9 && gr4.size == 10) + assert(gr3.size == 9 && gr4.size == 10) assert(gr5.sum == num.zero, gr5.toString) assert(!(gr3 contains (x * fromInt(10)))) assert((gr4 contains (x * fromInt(10)))) } } - + def main(args: Array[String]): Unit = { implicit val imp1 = Numeric.BigDecimalAsIfIntegral implicit val imp2 = Numeric.DoubleAsIfIntegral - + val _grs = List[GR[_]]( GR(BigDecimal(5.0)), GR(BigInt(5)), @@ -51,21 +51,21 @@ object Test { ) val grs = _grs ::: (_grs map (_.negated)) grs foreach (_.check) - + assert(NumericRange(1, 10, 1) sameElements (1 until 10)) assert(NumericRange.inclusive(1, 10, 1) sameElements (1 to 10)) assert(NumericRange.inclusive(1, 100, 3) sameElements (1 to 100 by 3)) - + // #2518 assert((3L to 7 by 2) sameElements List(3L, 5L, 7L)) - + rangeForeach(1 to 10); rangeForeach(1 until 10); rangeForeach(10 to 1 by -1); rangeForeach(10 until 1 by -1); rangeForeach(10 to 1 by -3); rangeForeach(10 until 1 by -3); - + // living on the edges boundaryTests() } diff --git a/test/files/run/records.scala b/test/files/run/records.scala index c1dc7b67e8..96b0b4cb0f 100644 --- a/test/files/run/records.scala +++ b/test/files/run/records.scala @@ -16,10 +16,10 @@ object Test { val y = new C { def f = 2 def g = " world" - } - + } + val z: T = y - + def main(args: Array[String]): Unit = { assert(x.f+z.f == 3) assert(x.g+z.g == "hello world") diff --git a/test/files/run/repl-backticks.scala b/test/files/run/repl-backticks.scala index 94e34d1438..11c58e18a1 100644 --- a/test/files/run/repl-backticks.scala +++ b/test/files/run/repl-backticks.scala @@ -1,18 +1,18 @@ -import scala.tools.nsc._ +import scala.tools.nsc._ object Test { val testCode = import java.lang.Thread.`yield` import scala.`package`.Throwable - - `yield` + + `yield` .text - + def main(args: Array[String]) = { val settings = new Settings() settings.classpath.value = System.getProperty("java.class.path") val repl = new Interpreter(settings) - repl.interpret(testCode) + repl.interpret(testCode) } } diff --git a/test/files/run/repl-suppressed-warnings.scala b/test/files/run/repl-suppressed-warnings.scala index a79131fb2f..a78b00f36e 100644 --- a/test/files/run/repl-suppressed-warnings.scala +++ b/test/files/run/repl-suppressed-warnings.scala @@ -20,7 +20,7 @@ object o { } case class DingDangDoobie(ding: Int, dang: Int, doobie: Double) case class Dongoo - @serializable case class Heyooooo + @serializable case class Heyooooo @deprecated("I'm an ironic deprecation warning") def f0 = 5 // where's this disappearing? def f1 = Double.Epsilon // and this? diff --git a/test/files/run/run-bug4840.scala b/test/files/run/run-bug4840.scala index dda280fd17..5f98bc9f4b 100644 --- a/test/files/run/run-bug4840.scala +++ b/test/files/run/run-bug4840.scala @@ -1,6 +1,6 @@ object Test { def g(x: Boolean): Option[String] = if (x) Some("booya") else None - + def f1() = { for (x <- g(true)) yield { g(false) match { @@ -9,11 +9,11 @@ object Test { } } } - + def f2() = { for (x <- g(true) ; y <- g(true) ; z <- g(true)) yield { for (x <- g(true) ; y <- g(true) ; z <- g(true)) yield { - g(true) map { _ => + g(true) map { _ => (null: Any) match { case Some(x: Int) => x case _ => 5 @@ -21,7 +21,7 @@ object Test { } } } - } + } def main(args: Array[String]): Unit = { println(f1()) diff --git a/test/files/run/runtime-richChar.scala b/test/files/run/runtime-richChar.scala index dceb70e74d..cf18a1d302 100644 --- a/test/files/run/runtime-richChar.scala +++ b/test/files/run/runtime-richChar.scala @@ -5,19 +5,19 @@ object Test extends App { else println(name + " failed: " + expected + " differs from " + got) } - + testSeq("'a' to 'c'", List('a', 'b', 'c'), 'a' to 'c') testSeq("'a' until 'c'", List('a', 'b'), 'a' until 'c') - + testSeq("'a' to 'b'", List('a', 'b'), 'a' to 'b') testSeq("'a' until 'b'", List('a'), 'a' until 'b') - + testSeq("'a' to 'a'", List('a'), 'a' to 'a') testSeq("'a' until 'a'", List(), 'a' until 'a') - + testSeq("'b' to 'a'", List(), 'b' to 'a') testSeq("'b' until 'a'", List(), 'b' until 'a') - + testSeq("'c' to 'a'", List(), 'c' to 'a') testSeq("'c' until 'a'", List(), 'c' until 'a') } diff --git a/test/files/run/scan.scala b/test/files/run/scan.scala index 47e0a7d976..f056c77ba1 100644 --- a/test/files/run/scan.scala +++ b/test/files/run/scan.scala @@ -6,17 +6,17 @@ object Test { def main(args: Array[String]) { val lst = List(1, 2, 3, 4, 5) - + assert(lst.scanLeft(0)(_ + _) == List(0, 1, 3, 6, 10, 15)) assert(lst.scanRight(0)(_ + _) == List(15, 14, 12, 9, 5, 0)) - + val emp = List[Int]() assert(emp.scanLeft(0)(_ + _) == List(0)) assert(emp.scanRight(0)(_ + _) == List(0)) - + val stream = Stream(1, 2, 3, 4, 5) assert(stream.scanLeft(0)(_ + _) == Stream(0, 1, 3, 6, 10, 15)) - + assert(Stream.from(1).scanLeft(0)(_ + _).take(5) == Stream(0, 1, 3, 6, 10)) } diff --git a/test/files/run/seqlike-kmp.scala b/test/files/run/seqlike-kmp.scala index af39fda9af..514990cfa2 100644 --- a/test/files/run/seqlike-kmp.scala +++ b/test/files/run/seqlike-kmp.scala @@ -2,7 +2,7 @@ object Test { val source = 0 to 99 val idxes = (-1 to 2) ++ (97 to 100) def str(xs: Seq[Int]) = xs.mkString("(", ", ", ")") - + def f(tgt: Seq[Int]) = { println("indexOfSlice") // the first index `>= from` such that... @@ -17,11 +17,11 @@ object Test { println(" %s with idx <= %d = %d".format(str(tgt), x, res)) } } - + def g(idx: Int, len: Int) = { f(source.slice(idx, idx + len)) } - + def main(args: Array[String]): Unit = { g(97, 1) g(97, 2) diff --git a/test/files/run/sequenceComparisons.scala b/test/files/run/sequenceComparisons.scala index c2f7ddc697..5d7958bc7e 100644 --- a/test/files/run/sequenceComparisons.scala +++ b/test/files/run/sequenceComparisons.scala @@ -2,12 +2,12 @@ import scala.collection.{ mutable, immutable } import collection.{ Seq, Traversable } object Test { - // TODO: + // TODO: // // SeqProxy // SeqForwarder // the commented out ones in seqMakers - + val seqMakers = List[List[Int] => Seq[Int]]( // scala.Array(_: _*), mutable.ArrayBuffer(_: _*), @@ -23,13 +23,13 @@ object Test { immutable.Seq(_: _*), mutable.Seq(_: _*), immutable.Stack(_: _*), - // mutable.Stack(_: _*), + // mutable.Stack(_: _*), immutable.IndexedSeq(_: _*), // was Vector //mutable.Vector(_: _*), immutable.List(_: _*), immutable.Stream(_: _*) ) - + abstract class Data[T] { val seq: Seq[T] private def seqList = seq.toList @@ -45,50 +45,50 @@ object Test { } lazy val eqeq = Method(_ == _, (List(seqList), List(Nil, seqList drop 1, seqList ::: seqList)), "%s == %s") - + val startsWithInputs: Inputs lazy val startsWith = Method(_ startsWith _, startsWithInputs, "%s startsWith %s") - + val endsWithInputs: Inputs lazy val endsWith = Method(_ endsWith _, endsWithInputs, "%s endsWith %s") val indexOfSliceInputs: Inputs private def subseqTest(s1: Seq[T], s2: Seq[T]) = (s1 indexOfSlice s2) != -1 lazy val indexOfSlice = Method(subseqTest _, indexOfSliceInputs, "(%s indexOfSlice %s) != -1") - + val sameElementsInputs: Inputs lazy val sameElements = Method(_ sameElements _, sameElementsInputs, "%s sameElements %s") - + def methodList = List(eqeq, startsWith, endsWith, indexOfSlice, sameElements) } - + object test1 extends Data[Int] { val seq = List(1,2,3,4,5) - + val startsWithInputs = ( List(Nil, List(1), List(1,2), seq), List(List(1,2,3,4,6), seq ::: List(5), List(0)) ) - + val endsWithInputs = ( List(Nil, List(5), List(4,5), seq), List(0 :: seq, List(5,2,3,4,5), List(3,4), List(5,6)) ) - + val indexOfSliceInputs = ( List(Nil, List(1), List(3), List(5), List(1,2), List(2,3,4), List(4,5), seq), List(List(1,2,3,5), List(6), List(5,4,3,2,1), List(2,1)) ) - + val sameElementsInputs = ( List(List(1,2,3,4,5)), List(Nil, List(1), List(1,2), List(2,3,4), List(2,3,4,5), List(2,3,4,5,1), List(1,2,3,5,4), seq reverse) ) } - + val failures = new mutable.ListBuffer[String] var testCount = 0 - + def assertOne(op1: Any, op2: Any, res: Boolean, str: String) { testCount += 1 val resStr = str.format(op1, op2) @@ -97,25 +97,25 @@ object Test { failures += ("FAIL: " + resStr) // assert(res, resStr) } - + def runSeqs() = { for (s1f <- seqMakers ; s2f <- seqMakers ; testData <- List(test1)) { import testData._ val scrut = s1f(seq) - + for (Method(f, (trueList, falseList), descr) <- methodList) { for (s <- trueList; rhs = s2f(s)) assertOne(scrut, rhs, f(scrut, rhs), descr) - + for (s <- falseList; rhs = s2f(s)) assertOne(scrut, rhs, !f(scrut, rhs), "!(" + descr + ")") } } } - + def main(args: Array[String]) { runSeqs() - + assert(failures.isEmpty, failures mkString "\n") } } diff --git a/test/files/run/serialize-stream.scala b/test/files/run/serialize-stream.scala index 3ab9f2df34..e424d5b629 100644 --- a/test/files/run/serialize-stream.scala +++ b/test/files/run/serialize-stream.scala @@ -5,13 +5,13 @@ object Test { val bos = new java.io.ByteArrayOutputStream() val oos = new java.io.ObjectOutputStream(bos) oos.writeObject(s) - + val ois = new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(bos.toByteArray)) val obj = ois.readObject() println(obj) println(obj.asInstanceOf[Seq[T]].toList) } - + def main(args: Array[String]) { ser(Stream(1, 2, 3)) ser(Stream(1)) diff --git a/test/files/run/slice-strings.scala b/test/files/run/slice-strings.scala index 129314387a..23085866f5 100644 --- a/test/files/run/slice-strings.scala +++ b/test/files/run/slice-strings.scala @@ -1,7 +1,7 @@ -object Test { +object Test { def cmp(x1: String) = { val x2 = x1.toList - + -10 to 10 foreach { i => assert(x1.take(i) == x2.take(i).mkString) assert(x1.drop(i) == x2.drop(i).mkString) @@ -12,7 +12,7 @@ object Test { assert(x1.slice(idx1, idx2) == x2.slice(idx1, idx2).mkString) } } - + def main(args: Array[String]): Unit = { cmp("abcde") } diff --git a/test/files/run/streamWithFilter.scala b/test/files/run/streamWithFilter.scala index cb919d4f55..7f8f9a09d2 100644 --- a/test/files/run/streamWithFilter.scala +++ b/test/files/run/streamWithFilter.scala @@ -4,7 +4,7 @@ object Test { def isBuzz(x: Int) = x % 5 == 0 // next line will run forever if withFilter isn't doing its thing. val fizzbuzzes = for (n <- nums ; if isFizz(n) ; if isBuzz(n)) yield n - + def main(args: Array[String]): Unit = { fizzbuzzes take 5 foreach println } diff --git a/test/files/run/streams.scala b/test/files/run/streams.scala index edf7ae368e..51b4e5d76c 100644 --- a/test/files/run/streams.scala +++ b/test/files/run/streams.scala @@ -29,7 +29,7 @@ object Test extends App { def powers(x: Int) = if ((x&(x-1)) == 0) Some(x) else None println(s3.flatMap(powers).reverse.head) - // large enough to generate StackOverflows (on most systems) + // large enough to generate StackOverflows (on most systems) // unless the following methods are tail call optimized. val size = 100000 diff --git a/test/files/run/stringbuilder.scala b/test/files/run/stringbuilder.scala index cc3eb032dc..ef85fc02a6 100644 --- a/test/files/run/stringbuilder.scala +++ b/test/files/run/stringbuilder.scala @@ -1,21 +1,21 @@ object Test extends App { val str = "ABCDEFGHIJKLMABCDEFGHIJKLM" val surrogateStr = "an old Turkic letter: \uD803\uDC22" - - type SB = { + + type SB = { def indexOf(str: String): Int def indexOf(str: String, fromIndex: Int): Int def lastIndexOf(str: String): Int def lastIndexOf(str: String, fromIndex: Int): Int } - + import scala.collection.mutable.{ StringBuilder => ScalaStringBuilder } import java.lang.{ StringBuilder => JavaStringBuilder } - + val sbScala = new ScalaStringBuilder() append str val sbJava = new JavaStringBuilder() append str val sbs: List[SB] = List[SB](sbScala, sbJava) - + def sameAnswers(f: (SB) => Int) = assert(f(sbScala) == f(sbJava)) sameAnswers(_.indexOf("")) @@ -31,10 +31,10 @@ object Test extends App { sameAnswers(_.lastIndexOf("QZV")) sameAnswers(_.lastIndexOf("GHI", 22)) sameAnswers(_.lastIndexOf("KLM", 22)) - + // testing that the "reverse" implementation avoids reversing surrogate pairs val jsb = new JavaStringBuilder(surrogateStr) reverse val ssb = new ScalaStringBuilder(surrogateStr) reverseContents ; - + assert(jsb.toString == ssb.toString) } diff --git a/test/files/run/structural.scala b/test/files/run/structural.scala index 97627b8da1..36af8c4bfc 100644 --- a/test/files/run/structural.scala +++ b/test/files/run/structural.scala @@ -1,18 +1,18 @@ object test1 { - + val o1 = new Object { override def toString = "ohone" } val o2 = new Object { override def toString = "ohtwo" } - + val t1 = new Tata("tieone") val t2 = new Tata("tietwo") - + class Tata(name: String) { override def toString = name def tatMe = "oy" } - + class Titi extends Tata("titi") - + object Rec { val a = 1 val b = 2 @@ -41,7 +41,7 @@ object test1 { val y: Tata = null def z(t: Tata) = () } - + type rt = Object { val a: Int; val c: String; @@ -65,7 +65,7 @@ object test1 { var v: Int val y: Tata } - + def l (r: rt) { println(" 1. " + r.c) println(" 2. " + r.a + 1) @@ -94,33 +94,33 @@ object test1 { println("25. " + r.y) println("26. " + r.e(null)) } - + /*def ma[T](r: Object{def e(x: T): T; val x: T}) { println("30. " + r.e(r.x)) // static error }*/ - + def mb(r: Object { def e[T](x: T): T }) { println("31. " + r.e[Int](4)) // while this is ok } - + def m1(r: Object { def z(x: Tata): Unit }) { println("32. " + r.z(new Titi)) // while this is ok } - + def m2[T](r: Object { def e(x: Tata): T; val x: Tata }) { println("33. " + r.e(r.x)) // and this too } - + class Rec3[T] { def e(x: T): T = x } - + def m3[T](r: Rec3[T], x: T) { println("33. " + r.e(x)) // and this too } - + Rec.g(11) - + this.l(Rec) this.mb(new Object{def e[T](x: T): T = x}) this.m1(Rec) @@ -132,7 +132,7 @@ object test2 { class C extends { def f() { println("1") } } val x1 = new C x1.f() - + abstract class D extends { def f() } val x2 = new D { def f() { println("2") } } x2.f() @@ -153,11 +153,11 @@ object test2 { object test3 { case class Exc extends Exception - + object Rec { def f = throw Exc() } - + def m(r: { def f: Nothing }) = try { r.f @@ -166,31 +166,31 @@ object test3 { case e: Exc => println("caught") case e => println(e) } - + m(Rec) - + } object test4 { class A - + val aar = Array(new A, new A, new A) val nar = Array(1, 2) - + def f(p: {def size: Int}) = println(p.size) //def g[T <: {def size: Int}](p: T) = println(p.size) // open issue //def h[T <% {def size: Int}](p: T) = println(p.size) // open issue - + f(aar) f(nar) - + //g(aar) //g(nar) - + //h(aar) //h(nar) - + } object Test extends App { diff --git a/test/files/run/sysprops.scala b/test/files/run/sysprops.scala index bdad677221..4d98e2cdd0 100644 --- a/test/files/run/sysprops.scala +++ b/test/files/run/sysprops.scala @@ -3,16 +3,16 @@ import sys._ /** Basic sys.Prop test. */ object Test { val key = "ding.dong.doobie" - + def bool() = { val prop = BooleanProp.valueIsTrue(key) assert(prop.key == key) - + prop.clear() assert(!prop.value) assert(!prop.isSet) assert(prop.get != null) - + prop set "dingus" assert(prop.get == "dingus") assert(!prop.value) @@ -32,7 +32,7 @@ object Test { prop.set("523") assert(prop.value == 523) prop.set("DingusInt") - + try { println(prop.value) ; assert(false, "should not get here") } catch { case _: Exception => () } } @@ -41,7 +41,7 @@ object Test { prop.set("55.0") assert(prop.value == 55.0) } - + def main(args: Array[String]): Unit = { bool() int() diff --git a/test/files/run/t0017.scala b/test/files/run/t0017.scala index 245cbb7e42..e976f453d8 100644 --- a/test/files/run/t0017.scala +++ b/test/files/run/t0017.scala @@ -7,7 +7,7 @@ def transpose[A](arr: Array[Array[A]]) = { var my_arr = Array(Array(1,2),Array(3,4)) -for (i <- Array.range(0, my_arr(0).length)) yield +for (i <- Array.range(0, my_arr(0).length)) yield for (row <- my_arr) yield row(i) val transposed = transpose(my_arr) diff --git a/test/files/run/t0325.scala b/test/files/run/t0325.scala index 236f1b101f..92331ab05f 100644 --- a/test/files/run/t0325.scala +++ b/test/files/run/t0325.scala @@ -7,7 +7,7 @@ case class RS(self: String) { } def split(separator: Char): Array[String] = self.split(escape(separator)) - + def split(separators: Array[Char]): Array[String] = { val re = separators.foldLeft("[")(_+escape(_)) + "]" self.split(re) @@ -27,7 +27,7 @@ object Test { case e@_ => println(which + " failed with " + e.getClass) } } - + def main(args: Array[String]) { val badChars = "?*{+([\\^.$" @@ -46,8 +46,8 @@ object Test { for ((c,str) <- badCases) test(("a"+c+"b").split(str.toArray),"RichString split(\""+ str + "\")") println - + for ((c,str) <- badCases) - test(RS("a"+c+"b").split(str.toArray),"RS split(\""+ str + "\")") + test(RS("a"+c+"b").split(str.toArray),"RS split(\""+ str + "\")") } } diff --git a/test/files/run/t0421.scala b/test/files/run/t0421.scala index 62be08c0fe..8d51013924 100644 --- a/test/files/run/t0421.scala +++ b/test/files/run/t0421.scala @@ -7,17 +7,17 @@ object Test extends App { } def scalprod(xs: Array[Double], ys: Array[Double]) = { - var acc = 0.0 - for ((x, y) <- xs zip ys) acc = acc + x * y + var acc = 0.0 + for ((x, y) <- xs zip ys) acc = acc + x * y acc } def matmul(xss: Array[Array[Double]], yss: Array[Array[Double]]) = { - val ysst = transpose(yss) + val ysst = transpose(yss) val ysst1: Array[Array[Double]] = yss.transpose assert(ysst.deep == ysst1.deep) for (xs <- xss) yield - for (yst <- ysst) yield + for (yst <- ysst) yield scalprod(xs, yst) } @@ -25,6 +25,6 @@ object Test extends App { println(transpose(a1).deep.mkString("[", ",", "]")) println(matmul(Array(Array(2, 3)), Array(Array(5), Array(7))).deep.mkString("[", ",", "]")) - + println(matmul(Array(Array(4)), Array(Array(6, 8))).deep.mkString("[", ",", "]")) } diff --git a/test/files/run/t0508.scala b/test/files/run/t0508.scala index 2283c46c36..0f4325e629 100644 --- a/test/files/run/t0508.scala +++ b/test/files/run/t0508.scala @@ -9,5 +9,5 @@ object Test extends App { } } - foo(Foo.unapply, Foo("this might be fun", 10)) + foo(Foo.unapply, Foo("this might be fun", 10)) } diff --git a/test/files/run/t0631.scala b/test/files/run/t0631.scala index c401ed31cb..5bceab6193 100644 --- a/test/files/run/t0631.scala +++ b/test/files/run/t0631.scala @@ -1,5 +1,5 @@ object Test extends App { - class Foo { + class Foo { override def equals(that: Any) = { println("Foo.equals called") super.equals(that) diff --git a/test/files/run/t0677.scala b/test/files/run/t0677.scala index 131fcc24a6..6c8a3a7e99 100644 --- a/test/files/run/t0677.scala +++ b/test/files/run/t0677.scala @@ -1,5 +1,5 @@ object Test extends App { - class X[T: ClassManifest] { + class X[T: ClassManifest] { val a = Array.ofDim[T](3, 4) } val x = new X[String] diff --git a/test/files/run/t0807.scala b/test/files/run/t0807.scala index 1e2a26664a..1a1add6b3a 100644 --- a/test/files/run/t0807.scala +++ b/test/files/run/t0807.scala @@ -1,5 +1,5 @@ trait A -trait B extends A { val x = println("early") } +trait B extends A { val x = println("early") } object Test extends App { new B {} } diff --git a/test/files/run/t0883.scala b/test/files/run/t0883.scala index c8ed06dbfe..adde95197b 100644 --- a/test/files/run/t0883.scala +++ b/test/files/run/t0883.scala @@ -1,14 +1,14 @@ object Foo { def apply(x: String) = new Foo(x) } class Foo(name: String) case object Bar extends Foo("Bar") -case class Baz() extends Foo("Baz") +case class Baz() extends Foo("Baz") object Test extends App { - Foo("Bar") match { - case Bar => println("What?") + Foo("Bar") match { + case Bar => println("What?") case _ => println("OK") } - Foo("Baz") match { - case Baz() => println("What?") + Foo("Baz") match { + case Baz() => println("What?") case _ => println("OK") - } + } } diff --git a/test/files/run/t1005.scala b/test/files/run/t1005.scala index 5ccd89dd85..60129bcc51 100644 --- a/test/files/run/t1005.scala +++ b/test/files/run/t1005.scala @@ -10,7 +10,7 @@ object Test object FromPoly{ def main(args : Array[String]) = (new Bar[AnyRef](Array[AnyRef]("Halp!"))).bar } - + def main(args: Array[String]): Unit = { println(FromMono main null mkString) println(FromPoly main null mkString) diff --git a/test/files/run/t1141.scala b/test/files/run/t1141.scala index 9641343c7e..ee4f2e7fd2 100644 --- a/test/files/run/t1141.scala +++ b/test/files/run/t1141.scala @@ -2,6 +2,6 @@ object Test extends App { val foo = new { def apply(args : String*) = args foreach println } - + foo("var", "args") } diff --git a/test/files/run/t1167.scala b/test/files/run/t1167.scala index 3dd0a30c00..c2ec4cff4e 100644 --- a/test/files/run/t1167.scala +++ b/test/files/run/t1167.scala @@ -10,17 +10,17 @@ trait Test1 { /* getName * Returns the binary name of the class if this class object represents a - * reference type that is not an array type. + * reference type that is not an array type. * getSimpleName * Returns the simple name of the underlying class as given in the source * code. Returns an empty string if the underlying class is anonymous. */ abstract class Foo { override def toString = getClass.getSimpleName - + abstract class Bar { override def toString = getClass.getSimpleName - } + } } object Test extends App { diff --git a/test/files/run/t1220.scala b/test/files/run/t1220.scala index 75e0ea07e8..0ba188d02d 100644 --- a/test/files/run/t1220.scala +++ b/test/files/run/t1220.scala @@ -1,7 +1,7 @@ object Test extends App { class QSRichIterable[A](self: Iterable[A]) { - def filterMap[R](f: PartialFunction[A,R]) = + def filterMap[R](f: PartialFunction[A,R]) = self filter (f.isDefinedAt) map f } diff --git a/test/files/run/t1300.scala b/test/files/run/t1300.scala index aa3580e33c..ce2f80eb4e 100644 --- a/test/files/run/t1300.scala +++ b/test/files/run/t1300.scala @@ -4,10 +4,10 @@ object Test extends App // val a1 = x1.toArray[Any] val a2 = Array('a','b','c','d').toArray[Any] val a3 = Array("e","f","g","h").toArray[Any] - + Array.copy(a3, 0, a1, 0, 4) Array.copy(a2, 0, a3, 0, 4) Array.copy(a2, 0, a1, 0, 4) - + println(a1.mkString + a2.mkString + a3.mkString) } diff --git a/test/files/run/t1309.scala b/test/files/run/t1309.scala index 84963549a2..b6a75fe6ae 100644 --- a/test/files/run/t1309.scala +++ b/test/files/run/t1309.scala @@ -1,6 +1,6 @@ object Test { def f(ras: => IndexedSeq[Byte]): IndexedSeq[Byte] = ras - + def main(args: Array[String]): Unit = { f(new Array[Byte](0)) } diff --git a/test/files/run/t1323.scala b/test/files/run/t1323.scala index 94b51bd2a4..8209b85219 100644 --- a/test/files/run/t1323.scala +++ b/test/files/run/t1323.scala @@ -3,9 +3,9 @@ object Test extends App { println(" 2:" + List(1,2,3,4).indexOfSlice(List(1,2))) // 0 println(" 3:" + List(1,2,3,4).indexOfSlice(List(2,3))) // 1 println(" 4:" + List(1,2,3,4).indexOfSlice(List(3,4))) // 2 - println(" 5:" + List(1,2,3,4).indexOfSlice(List(4,5))) // -1 + println(" 5:" + List(1,2,3,4).indexOfSlice(List(4,5))) // -1 println(" 6:" + List(1,2,3,4).indexOfSlice(List(2,4))) // -1 - println(" 7:" + List(1,2,3,4).indexOfSlice(List(4,3))) // -1 + println(" 7:" + List(1,2,3,4).indexOfSlice(List(4,3))) // -1 println(" 8:" + List(1,2,3,4).indexOfSlice(List(1,3))) // -1 println(" 9:" + List(1,2,3,4).indexOfSlice(List(1,3))) // -1 println("10:" + List(1,2,3,4).indexOfSlice(List(1,2,3,4))) // 0 diff --git a/test/files/run/t1333.scala b/test/files/run/t1333.scala index 1696629cbb..514b4ffc8a 100644 --- a/test/files/run/t1333.scala +++ b/test/files/run/t1333.scala @@ -1,11 +1,11 @@ object Test { case class A(x: Int)(y: Int)(z: String) - + def f(x: Any) = x match { case A(x) => x case _ => -1 } - + def main(args: Array[String]): Unit = { println(f(A(10)(20)("abc"))) println(f(A(-10)(20)("abc"))) diff --git a/test/files/run/t1423.scala b/test/files/run/t1423.scala index 073483aeee..44c6653287 100644 --- a/test/files/run/t1423.scala +++ b/test/files/run/t1423.scala @@ -5,4 +5,4 @@ object Test extends App{ case 1L => println(1); case _ => println("????"); } -} +} diff --git a/test/files/run/t1427.scala b/test/files/run/t1427.scala index ab0a42c7b7..21bd71ffef 100644 --- a/test/files/run/t1427.scala +++ b/test/files/run/t1427.scala @@ -9,7 +9,7 @@ object Test { def main(args: Array[String]): Unit = { val x = new Bob[List] val results = List(x, new Bob[Set], 55) map (x foo _) - + assert(results == List(true, true, false)) } } diff --git a/test/files/run/t1500.scala b/test/files/run/t1500.scala index ce6278cd05..c312a9a883 100644 --- a/test/files/run/t1500.scala +++ b/test/files/run/t1500.scala @@ -1,23 +1,23 @@ -import scala.tools.nsc._ +import scala.tools.nsc._ object Test { - + /** * Type inference overlooks constraints posed by type parameters in annotations on types. */ - + val testCode = - + class posingAs[A] extends TypeConstraint - + def resolve[A,B](x: A @posingAs[B]): B = x.asInstanceOf[B] - + val x = resolve(7: @posingAs[Any]) - + .text - + def main(args: Array[String]) = { - + val settings = new Settings() settings.classpath.value = System.getProperty("java.class.path") val tool = new Interpreter(settings) @@ -35,11 +35,11 @@ object Test { } } - + global.addAnnotationChecker(checker) - + tool.interpret(testCode) - + } } diff --git a/test/files/run/t1501.scala b/test/files/run/t1501.scala index f1eb8f287d..05e4da8c7a 100644 --- a/test/files/run/t1501.scala +++ b/test/files/run/t1501.scala @@ -1,15 +1,15 @@ -import scala.tools.nsc._ +import scala.tools.nsc._ object Test { - + /** * ... */ - + val testCode = - + class xyz[A] extends TypeConstraint - + def loopWhile[T](cond: =>Boolean)(body: =>(Unit @xyz[T])): Unit @ xyz[T] = {{ if (cond) {{ body @@ -24,9 +24,9 @@ object Test { (): @xyz[Int] }} }} - + .text - + def main(args: Array[String]) = { val settings = new Settings() settings.classpath.value = System.getProperty("java.class.path") @@ -45,11 +45,11 @@ object Test { } } - + global.addAnnotationChecker(checker) - + tool.interpret(testCode) - + } } diff --git a/test/files/run/t1537.scala b/test/files/run/t1537.scala index 1dce501990..ddbfb29ac4 100644 --- a/test/files/run/t1537.scala +++ b/test/files/run/t1537.scala @@ -4,15 +4,15 @@ trait Syntax { trait Evaluation { val syntax: Syntax - + def equalInTrait = this.syntax.Foo == this.syntax.Foo } object Test extends Evaluation with App { - object syntax extends Syntax + object syntax extends Syntax def equalInObject = this.syntax.Foo == this.syntax.Foo - + println(equalInTrait) println(equalInObject) } diff --git a/test/files/run/t1591.scala b/test/files/run/t1591.scala index 6dd9605042..bd43f0b23d 100644 --- a/test/files/run/t1591.scala +++ b/test/files/run/t1591.scala @@ -1,8 +1,8 @@ abstract class A { - + lazy val lazyBar = bar - - object bar { + + object bar { val foo = 12 } diff --git a/test/files/run/t1718.scala b/test/files/run/t1718.scala index d1b19c38cd..358bd1be5a 100644 --- a/test/files/run/t1718.scala +++ b/test/files/run/t1718.scala @@ -1,10 +1,10 @@ object Test extends App{ - def matchesNull[T](mightBeNull: Array[T]): Boolean = mightBeNull match { + def matchesNull[T](mightBeNull: Array[T]): Boolean = mightBeNull match { case null => true case x => false } val nullArray: Array[String] = null - println(matchesNull(nullArray)) + println(matchesNull(nullArray)) } diff --git a/test/files/run/t1766.scala b/test/files/run/t1766.scala index 638384d4f9..2afd883755 100644 --- a/test/files/run/t1766.scala +++ b/test/files/run/t1766.scala @@ -1,16 +1,16 @@ object Test extends App { - + class C(s: String) { - + def this(i: Int) = this("bar") - + def f = { val v: { def n: Int } = new { val n = 3 } v.n } - + } - + new C("foo").f - + } diff --git a/test/files/run/t1773.scala b/test/files/run/t1773.scala index 7c95df62f8..c50b62512f 100644 --- a/test/files/run/t1773.scala +++ b/test/files/run/t1773.scala @@ -7,6 +7,6 @@ object Test extends App {""}, { if (true) "" else "I like turtles" } ) - + for (x1 <- xs; x2 <- xs) assert (x1 xml_== x2) } diff --git a/test/files/run/t1829.scala b/test/files/run/t1829.scala index 8240527424..7c39d33ae9 100644 --- a/test/files/run/t1829.scala +++ b/test/files/run/t1829.scala @@ -1,6 +1,6 @@ object Test{ def main(args : Array[String]){ - import scala.collection.immutable._ + import scala.collection.immutable._ assert(IntMap.empty == HashMap.empty); assert(HashMap.empty == IntMap.empty); assert(LongMap.empty == HashMap.empty); diff --git a/test/files/run/t2029.scala b/test/files/run/t2029.scala index 32b04f0b47..1cbe97a350 100644 --- a/test/files/run/t2029.scala +++ b/test/files/run/t2029.scala @@ -3,10 +3,10 @@ object Test{ import scala.collection.immutable.TreeSet; val mainSet = TreeSet(1 to 5 :_*) - + var compareCalled = false; val smallerSet = TreeSet(2 to 4 :_*)(Ordering[Int].reverse) - + println(mainSet.mkString(",")) println(smallerSet.mkString(",")) println(smallerSet.subsetOf(mainSet)); diff --git a/test/files/run/t2074_2.scala b/test/files/run/t2074_2.scala index 4624170f89..1f59e0b8a1 100644 --- a/test/files/run/t2074_2.scala +++ b/test/files/run/t2074_2.scala @@ -12,7 +12,7 @@ object Test { def iterator = underlying.iterator } val w = IndexedSeq(1, 2, 3).view - + def main(args: Array[String]): Unit = { println(v) println(w) diff --git a/test/files/run/t2087-and-2400.scala b/test/files/run/t2087-and-2400.scala index 19a5df26e3..93cd633ffb 100644 --- a/test/files/run/t2087-and-2400.scala +++ b/test/files/run/t2087-and-2400.scala @@ -3,14 +3,14 @@ object Test def negativeCharMaker = new (Short => Char) { def apply(x: Short) = x.toChar } def main(args: Array[String]): Unit = { // throws exception if -100 gets to Character.valueOf - val x = negativeCharMaker(-100) - + val x = negativeCharMaker(-100) + // chars are unsigned, they should never be equal to negative values assert((-100).toShort != (-100).toChar) assert((-100).toChar != (-100).toShort) assert((-100).toChar != (-100).toByte) assert((-100).toByte != (-100).toChar) - + // BoxesRunTime must agree as well assert(((-100).toShort: Any) != (-100).toChar) assert(((-100).toChar: Any) != (-100).toShort) diff --git a/test/files/run/t2124.scala b/test/files/run/t2124.scala index e72deb09bc..a4fd654d76 100644 --- a/test/files/run/t2124.scala +++ b/test/files/run/t2124.scala @@ -9,7 +9,7 @@ object Test { println(new RuleTransformer(new RewriteRule { - override def transform(n: Node): NodeSeq = { + override def transform(n: Node): NodeSeq = { val result = n match { case {_*} => diff --git a/test/files/run/t2125.scala b/test/files/run/t2125.scala index 8314e4f019..a10ed9827b 100644 --- a/test/files/run/t2125.scala +++ b/test/files/run/t2125.scala @@ -5,11 +5,11 @@ import scala.xml.transform._ object Test { val sampleXml =

- + def main(args: scala.Array[String]) { println(new RuleTransformer(new RewriteRule { - override def transform(n: Node): NodeSeq = { + override def transform(n: Node): NodeSeq = { val result = n match { diff --git a/test/files/run/t2276.scala b/test/files/run/t2276.scala index ed5714e9fa..f0404e5fab 100644 --- a/test/files/run/t2276.scala +++ b/test/files/run/t2276.scala @@ -2,7 +2,7 @@ import scala.xml._ import scala.xml.transform._ object Test extends App { - val inputXml : Node = + val inputXml : Node = 1 diff --git a/test/files/run/t2308a.scala b/test/files/run/t2308a.scala index fff158c772..abb568064a 100644 --- a/test/files/run/t2308a.scala +++ b/test/files/run/t2308a.scala @@ -1,7 +1,7 @@ object Test { trait T[M[_]] - + def f1 = classOf[T[X] forSome { type X[_] } ] - + def main(args: Array[String]): Unit = println(f1) } diff --git a/test/files/run/t2354.scala b/test/files/run/t2354.scala index f46db13a95..5419911ac3 100644 --- a/test/files/run/t2354.scala +++ b/test/files/run/t2354.scala @@ -8,7 +8,7 @@ object Test val parser1 = ConstructingParser.fromSource(Source.fromString(xml_good),false) val parser2 = ConstructingParser.fromSource(Source.fromString(xml_bad),false) - + def main(args: Array[String]): Unit = { parser1.document parser2.document diff --git a/test/files/run/t2417.scala b/test/files/run/t2417.scala index 6200e33025..2d0bc2d405 100644 --- a/test/files/run/t2417.scala +++ b/test/files/run/t2417.scala @@ -1,6 +1,6 @@ // #2417 object Test { - + def parallel(numThreads: Int)(block: => Unit) { var failure: Throwable = null val threads = Array.tabulate(numThreads)(i => new Thread { @@ -16,7 +16,7 @@ object Test { for (t <- threads) t.join if (failure != null) println("FAILURE: " + failure) } - + def testSet(initialSize: Int, numThreads: Int, passes: Int) { val orig = Set.empty ++ (1 to initialSize) parallel(numThreads) { @@ -32,7 +32,7 @@ object Test { } } } - + def testMap(initialSize: Int, numThreads: Int, passes: Int) { val orig = Map.empty ++ ((1 to initialSize) map ((_,"v"))) parallel(numThreads) { @@ -48,28 +48,28 @@ object Test { } } } - + def main(args: Array[String]) { println("testing small Map that doesn't promote to HashMap...") testMap(4, 2, 1000000) println() - + println("testing single-threaded HashMap use...") testMap(5, 1, 1000000) println() - + println("testing HashMap.size from multiple threads...") testMap(5, 2, 1000000) println() - + println("testing small Set that doesn't promote to HashSet...") testSet(4, 2, 1000000) println() - + println("testing single-threaded HashSet use...") testSet(5, 1, 1000000) println() - + println("testing HashSet.size from multiple threads...") testSet(5, 2, 1000000) println() diff --git a/test/files/run/t2512.scala b/test/files/run/t2512.scala index 8166839a9a..de20af5e72 100644 --- a/test/files/run/t2512.scala +++ b/test/files/run/t2512.scala @@ -3,11 +3,11 @@ import scala.tools.nsc.util.HashSet object Test { val runs = 10000 class Bop - + def main(args: Array[String]): Unit = { val set: HashSet[Bop] = HashSet("Bop", 16) (1 to runs).toList foreach (_ => set addEntry new Bop) - + assert(runs == set.size && set.size == set.iterator.length) } } diff --git a/test/files/run/t2514.scala b/test/files/run/t2514.scala index e23b441ecf..21c4afb472 100644 --- a/test/files/run/t2514.scala +++ b/test/files/run/t2514.scala @@ -1,7 +1,7 @@ object Test { implicit def x[A](a: A) = new { def xx = a } - + def main(args: Array[String]): Unit = { val r1 = 12 xx; val r2 = 12.xx @@ -9,7 +9,7 @@ object Test val r4 = 12.xx + 12.xx val r5 = 12.`xx` + 12.xx val r6 = 12.3.`xx` + 12.xx - + assert(r5 == 24) } } \ No newline at end of file diff --git a/test/files/run/t2526.scala b/test/files/run/t2526.scala index 53f3059135..d37185535f 100644 --- a/test/files/run/t2526.scala +++ b/test/files/run/t2526.scala @@ -4,18 +4,18 @@ */ object Test { import collection._ - + def main(args: Array[String]) { val m = new mutable.HashMap[String, String] - + /* Use non hash-based structure for verification */ val keys = List("a", "b", "c", "d", "e") val valueSuffix = "value" val values = keys.map(_ + valueSuffix) val entries = keys.zip(values) - + for (k <- keys) m(k) = k + valueSuffix - + assertForeach(keys, m.keySet.iterator) assertForeach(keys, m.keysIterator) assertForeach(keys, m.keySet) @@ -25,7 +25,7 @@ object Test { assertForeach(entries, m) } - + /* Checks foreach of `actual` goes over all the elements in `expected` */ private def assertForeach[E](expected: Traversable[E], actual: Iterator[E]): Unit = { val notYetFound = new mutable.ArrayBuffer[E]() ++= expected @@ -35,12 +35,12 @@ object Test { } assert(notYetFound.size == 0, "mutable.HashMap.foreach should have iterated over: " + notYetFound) } - - /* + + /* * Checks foreach of `actual` goes over all the elements in `expected` * We duplicate the method above because there is no common inteface between Traversable and * Iterator and we want to avoid converting between collections to ensure that we test what - * we mean to test. + * we mean to test. */ private def assertForeach[E](expected: Traversable[E], actual: Traversable[E]): Unit = { val notYetFound = new mutable.ArrayBuffer[E]() ++= expected diff --git a/test/files/run/t2552.scala b/test/files/run/t2552.scala index 0c6b4f005b..17dcac596b 100644 --- a/test/files/run/t2552.scala +++ b/test/files/run/t2552.scala @@ -2,11 +2,11 @@ object Test extends App { def testTakeWhile = { val numbers = Iterator.range(0, 50) val zeroTo9 = numbers.takeWhile(x => { println("p(" + x + ")"); x < 10 } ) - + zeroTo9.foreach(println _) - + val zeroTo1 = Iterator.range(0, 20).takeWhile(x => { println("p(" + x + ")"); x < 2 } ) - + println(zeroTo1.hasNext) println(zeroTo1.hasNext) println(zeroTo1.next) @@ -15,16 +15,16 @@ object Test extends App { println(zeroTo1.hasNext) println(zeroTo1.hasNext) } - + def testFilter = { val predicate = (x: Int) => { println("p(" + x + ")"); x % 2 == 0 } - + val evens = Iterator.range(0, 10).filter(predicate) - + println(evens.hasNext) println(evens.hasNext) println(evens.next) - + evens.foreach(println _) } diff --git a/test/files/run/t2636.scala b/test/files/run/t2636.scala index 8c49a733fd..3271f79ffc 100644 --- a/test/files/run/t2636.scala +++ b/test/files/run/t2636.scala @@ -3,28 +3,28 @@ object Test type Foo = { def update(x: Int, value: String): Unit } type Foo2 = { def update(x: Int, value: String): Int } type Foo3 = { def update(x: Int, value: String): Array[Int] } - + def alen() = { type L1 = { def length: Int } def len(p: L1) = p.length val x: L1 = Array(1,2,3) len(x) } - + type A1 = { def apply(x: Int): String } def arrApply(a: A1, x: Int) = a(x) - + def main(args: Array[String]): Unit = { val arr = new Array[String](3) val p1: Foo = arr def a1 = p1(0) = "b" val p2: Foo2 = new { def update(x: Int, value: String) = { p1(1) = "o" ; 1 } } - def a2 = p2(0) = "c" - + def a2 = p2(0) = "c" + val p3: Foo3 = new { def update(x: Int, value: String) = { p1(2) = "b" ; Array(1) } } def a3 = p3(10) = "hi mom" - + a1 ; a2 ; a3 ; assert(arr.mkString == "bob") diff --git a/test/files/run/t266.scala b/test/files/run/t266.scala index 20a29dabbb..1fd6dab185 100644 --- a/test/files/run/t266.scala +++ b/test/files/run/t266.scala @@ -2,9 +2,9 @@ trait O { self: Test.type => - + Nil foreach identity - + def f = (1 to 10).toList map identity } diff --git a/test/files/run/t2721.scala b/test/files/run/t2721.scala index 8bd03bc838..93af884a60 100644 --- a/test/files/run/t2721.scala +++ b/test/files/run/t2721.scala @@ -2,9 +2,9 @@ object Test { val xml1 = val xml2= scala.xml.XML.loadString("""""") - + def backslashSearch(x: xml.Elem) = "root:-"+(x \ "@{nsUri}at") +"-sub:-"+(x \ "sub" \ "@{nsUri}at") +"-" - + def main(args: Array[String]): Unit = { println(backslashSearch(xml1)) println(backslashSearch(xml2)) diff --git a/test/files/run/t2755.scala b/test/files/run/t2755.scala index 8d10b56734..c279ecc24e 100644 --- a/test/files/run/t2755.scala +++ b/test/files/run/t2755.scala @@ -28,7 +28,7 @@ object Test { case x: Array[_] => 6 case _ => 7 } - + def main(args: Array[String]): Unit = { println(f1(Array(1, 2, 3))) @@ -38,7 +38,7 @@ object Test { println(f1(new Array[Any](10))) // should match as Array[AnyRef] println(f1(Array(1L))) println(f1(null)) - + println(f2(Array(1, 2, 3))) println(f2(Array(1.0, -2.0, 3.0, 1.0))) println(f2(Array(1.0f, 2.0f, 3.0f, -3.0f))) @@ -46,7 +46,7 @@ object Test { println(f2(new Array[Any](10))) // should match as Array[AnyRef] println(f2(Array(1L))) println(f2(null)) - + println(f3(Array(1, 2, 3))) println(f3(Array(1.0, -2.0, 3.0, 1.0))) println(f3(Array(1.0f, 2.0f, 3.0f, -3.0f))) diff --git a/test/files/run/t2800.scala b/test/files/run/t2800.scala index 84d1de0507..cc6fb30bbc 100644 --- a/test/files/run/t2800.scala +++ b/test/files/run/t2800.scala @@ -3,20 +3,20 @@ object Test { def f2 = (5: Any) match { case List(x @ _*) => x ; case _ => false } def f3 = (Nil: Any) match { case List(x @ _*) => x ; case _ => false } def f4 = (Array(1): Any) match { case List(x @ _*) => x ; case _ => false } - + def f5 = ("": Any) match { case Array(x @ _*) => x ; case _ => false } def f6 = (5: Any) match { case Array(x @ _*) => x ; case _ => false } def f7 = (Nil: Any) match { case Array(x @ _*) => x ; case _ => false } def f8 = (Array(1): Any) match { case Array(x @ _*) => x ; case _ => false } - + def f9 = ("": Any) match { case x @ List(_*) => x ; case _ => false } def f10 = ("": Any) match { case List(_*) => true ; case _ => false } def f11 = (Nil: Any) match { case List(_*) => true ; case _ => false } def f12 = ("": Any) match { case x @ Array(_*) => x ; case _ => false } def f13 = ("": Any) match { case Array(_*) => true ; case _ => false } def f14 = (Nil: Any) match { case Array(_*) => true ; case _ => false } - - + + def main(args: Array[String]): Unit = { println(f1) println(f2) diff --git a/test/files/run/t2849.scala b/test/files/run/t2849.scala index cadf605ae0..0995f64010 100644 --- a/test/files/run/t2849.scala +++ b/test/files/run/t2849.scala @@ -16,9 +16,9 @@ object Test { def ticketExample { var big = 100000 - + var aSortedSet: SortedSet[Int] = TreeSet(big) - + for (i <- 1 until N) { aSortedSet = (aSortedSet - big) ++ (TreeSet(i, big - 1)) big -= 1 @@ -42,7 +42,7 @@ object Test { } } } - + } diff --git a/test/files/run/t2867.scala b/test/files/run/t2867.scala index 25e55eaecd..0d30f95f8d 100644 --- a/test/files/run/t2867.scala +++ b/test/files/run/t2867.scala @@ -1,6 +1,6 @@ object Test { - case class A(l: List[_]*) - + case class A(l: List[_]*) + def main(args: Array[String]): Unit = { /** Kind of sneaking a slightly different test in here as well as * testing 2867. How subversive. @@ -9,7 +9,7 @@ object Test { val xs2 = List(1.0, 2.0, 3.0) val xs3 = List[Any](1.0f, 2.0f, 3.0f) val xs4 = List[Byte](1, 2, 3) - + assert(A(List(xs1, xs2)) == A(List(xs3, xs4))) } } diff --git a/test/files/run/t2958.scala b/test/files/run/t2958.scala index dcd24ecc36..b9563a1b77 100644 --- a/test/files/run/t2958.scala +++ b/test/files/run/t2958.scala @@ -2,14 +2,14 @@ object Test { def f(args: Array[String]) = args match { case Array("-p", prefix, from, to) => prefix + from + to - + case Array(from, to) => from + to case _ => "default" } - + def main(args: Array[String]) { assert(f(Array("1", "2")) == "12") } diff --git a/test/files/run/t3026.scala b/test/files/run/t3026.scala index 22dde9cc03..0231c7bcd1 100755 --- a/test/files/run/t3026.scala +++ b/test/files/run/t3026.scala @@ -3,6 +3,6 @@ object Test { case object RED extends Colour case object YELLOW extends Colour val items = Array(RED, YELLOW) - + def main(args: Array[String]): Unit = items foreach println } diff --git a/test/files/run/t3038.scala b/test/files/run/t3038.scala index 7eb69f7fb5..986fc982e7 100644 --- a/test/files/run/t3038.scala +++ b/test/files/run/t3038.scala @@ -2,18 +2,18 @@ class A { private lazy val a1 = "a1" object B private lazy val a2 = "a2" - + @transient lazy val a3 = "a3" @transient private lazy val a4 = "a4" @transient lazy val a5 = "a5" @transient private lazy val a6 = "a6" - + final val a7 = "a7" private final val a8 = "a8" @transient final val a9 = "a9" - - + + def run = { @@ -27,13 +27,13 @@ class A { println(a7) println(a8) println(a9) - } + } } class C extends A { private lazy val c1 = "c1" lazy val c2 = "c2" - + private lazy val c3 = "c3" @transient lazy val c4 = "c4" @@ -41,7 +41,7 @@ class C extends A { @transient lazy val c6 = "c6" @transient private lazy val c7 = "c7" lazy val c8 = "c8" - + final val c9 = "c9" private final val c10 = "c10" diff --git a/test/files/run/t3038c/A_1.scala b/test/files/run/t3038c/A_1.scala index 91564e3021..14579fcf67 100644 --- a/test/files/run/t3038c/A_1.scala +++ b/test/files/run/t3038c/A_1.scala @@ -59,7 +59,7 @@ class A { lazy val a57 = 58 lazy val a58 = 59 lazy val a59 = 60 - private lazy val a60 = 61 + private lazy val a60 = 61 private lazy val a61 = 62 private lazy val a62 = 63 private lazy val a63 = 64 @@ -69,7 +69,7 @@ class A { private lazy val a67 = 68 private lazy val a68 = 69 private lazy val a69 = 70 - + def run = { println(List(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, diff --git a/test/files/run/t3038d.scala b/test/files/run/t3038d.scala index a92e3532a8..6cd2d83776 100644 --- a/test/files/run/t3038d.scala +++ b/test/files/run/t3038d.scala @@ -22,13 +22,13 @@ class Bar extends Foo { @transient protected var first: Any = null def size = a @transient var second: Any = null - + def checkMember { first } - + private def writeObject(out: java.io.ObjectOutputStream) { serializeTo(out) } - + private def readObject(in: java.io.ObjectInputStream) { first = null init(in) @@ -40,7 +40,7 @@ object Test { val in = new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(bytes)) in.readObject.asInstanceOf[A] } - + private def toBytes(o: AnyRef): Array[Byte] = { val bos = new java.io.ByteArrayOutputStream val out = new java.io.ObjectOutputStream(bos) @@ -49,7 +49,7 @@ object Test { bos.toByteArray } - + def main(args: Array[String]) { val a1 = new Bar() val serialized:Array[Byte] = toBytes(a1) diff --git a/test/files/run/t3050.scala b/test/files/run/t3050.scala index d1f3f13bec..ca9d91e191 100644 --- a/test/files/run/t3050.scala +++ b/test/files/run/t3050.scala @@ -1,9 +1,9 @@ object Test { def main(args: Array[String]): Unit = { - val x = + val x = try { ("": Any) match { case List(_*) => true } } catch { case _ => false } - + assert(!x) } } diff --git a/test/files/run/t3112.scala b/test/files/run/t3112.scala index eb8eec6327..88677fa09e 100644 --- a/test/files/run/t3112.scala +++ b/test/files/run/t3112.scala @@ -7,5 +7,5 @@ object Test { println((Vector() ++ (0 until 32)) takeRight 0) // works println((Vector() ++ (0 until 33)) takeRight 0) // error } - + } \ No newline at end of file diff --git a/test/files/run/t3150.scala b/test/files/run/t3150.scala index 034703b5f7..8acdb50354 100644 --- a/test/files/run/t3150.scala +++ b/test/files/run/t3150.scala @@ -1,7 +1,7 @@ object Test { case object Bob { override def equals(other: Any) = true } def f(x: Any) = x match { case Bob => Bob } - + def main(args: Array[String]): Unit = { assert(f(Bob) eq Bob) assert(f(0) eq Bob) diff --git a/test/files/run/t3158.scala b/test/files/run/t3158.scala index c824b62e96..2261b5cd81 100644 --- a/test/files/run/t3158.scala +++ b/test/files/run/t3158.scala @@ -1,6 +1,6 @@ object Test { def main(args: Array[String]) { - println(args.map(_ => foo _).deep) + println(args.map(_ => foo _).deep) } def foo(xs: String*) { diff --git a/test/files/run/t3175.scala b/test/files/run/t3175.scala index 78660d4085..aff2e67d0d 100644 --- a/test/files/run/t3175.scala +++ b/test/files/run/t3175.scala @@ -6,46 +6,46 @@ object Test { def f1(x:{ def apply(x: Int): Long }) = x(0) def f2(x:{ def apply(x: Int): Byte }) = x(0) def f3(x:{ def apply(x: Int): String }) = x(0).length - + def f4(x:{ def update(x: Int, y: Long): Unit }, y: Long) = x(0) = y def f5(x:{ def update(x: Int, y: Byte): Unit }, y: Byte) = x(0) = y def f6(x:{ def update(x: Int, y: String): Unit }, y: String) = x(0) = y - + def f7(x: { def length: Any }) = x.length - + def f8(x: { def apply(x: Int): Any }) = x(0) def f9(x: { def apply(x: Int): Int }) = x(0) def f10(x: { def apply(x: Int): Long }) = x(0) - + // update has some interesting special cases def f11(x:{ def update(x: Int, y: Long): Any }, y: Long) = x(0) = y - def f12(x:{ def update(x: Int, y: String): AnyVal }, y: String) = x(0) = y + def f12(x:{ def update(x: Int, y: String): AnyVal }, y: String) = x(0) = y def f13(x:{ def update(x: Int, y: String): AnyRef }, y: String) = x(0) = y - + // doesn't work yet, see #3197 // def fclone(x:{ def clone(): AnyRef }) = x.clone() - + def main(args: Array[String]): Unit = { val longs = Array(5L) val bytes = Array(5: Byte) val strs = Array("abcde", "fghjij") - + println(len(Array(1,2,3)) + len(Array(4.0,5.0f)) + len(Array("abc", 5)) + len("bop")) println(f1(longs) + f2(bytes) + f3(strs)) - + f4(longs, 1) f5(bytes, 1) f6(strs, "a") - + println(f1(longs) + f2(bytes) + f3(strs)) - + println(f7(Array(1,2,3))) println(f7("def")) - + println(f8(Array(5))) println(f9(Array(5))) println(f10(Array(5))) - + f11(longs, 100L) f12(strs, "jabooboo") println(longs(0)) diff --git a/test/files/run/t3232.scala b/test/files/run/t3232.scala index acb1a1e0e9..feff7e7089 100644 --- a/test/files/run/t3232.scala +++ b/test/files/run/t3232.scala @@ -4,14 +4,14 @@ object Test { val r2 = 1 to Int.MaxValue val r3 = Int.MinValue to -2 val r4 = Int.MinValue until -1 - + // some exceptional conditions val e1 = () => (0 to Int.MaxValue).length val e2 = () => (5 until 5).last - + def main(args: Array[String]): Unit = { List(r1, r2, r3, r4) foreach (x => assert(x.length == Int.MaxValue)) - + // exception required List(e1, e2) foreach { f => try { f() ; assert(false) } diff --git a/test/files/run/t3269.scala b/test/files/run/t3269.scala index 17e42cdb0e..6fe727111c 100644 --- a/test/files/run/t3269.scala +++ b/test/files/run/t3269.scala @@ -4,6 +4,6 @@ object Test { println(it.next) it.hasNext it.hasNext - it.hasNext + it.hasNext } } diff --git a/test/files/run/t3273.scala b/test/files/run/t3273.scala index 379a8a29c1..a4dfc4b30c 100644 --- a/test/files/run/t3273.scala +++ b/test/files/run/t3273.scala @@ -1,7 +1,7 @@ object Test { val num1: Stream[Int] = 1 #:: num1.map(_ + 1) val num2: Stream[Int] = 1 #:: num2.iterator.map(_ + 1).toStream - + def main(args: Array[String]): Unit = { val x1 = (num1 take 10).toList val x2 = (num2 take 10).toList diff --git a/test/files/run/t3361.scala b/test/files/run/t3361.scala index 892e36dbd9..7fbc6777f2 100644 --- a/test/files/run/t3361.scala +++ b/test/files/run/t3361.scala @@ -40,7 +40,7 @@ object Test extends App { def insert_1 { val ten = DoubleLinkedList(1 to 10: _*) ten.append(DoubleLinkedList(11)) - + // Post-insert size test require(11 == ten.size) // Post-insert data test diff --git a/test/files/run/t3395.scala b/test/files/run/t3395.scala index b4990a1716..01cc431871 100644 --- a/test/files/run/t3395.scala +++ b/test/files/run/t3395.scala @@ -1,11 +1,11 @@ object Test { def main(args: Array[String]): Unit = { - Seq("") match { + Seq("") match { case Seq("") => println("abc") case Seq(_, _, x) => println(x) } - - Seq(1, 2, "def") match { + + Seq(1, 2, "def") match { case Seq("") => println("abc") case Seq(_, _, x) => println(x) } diff --git a/test/files/run/t3397.scala b/test/files/run/t3397.scala index 2c8cbed3ab..243fe766de 100644 --- a/test/files/run/t3397.scala +++ b/test/files/run/t3397.scala @@ -1,7 +1,7 @@ object Test { def main(args: Array[String]): Unit = { val x = Seq(Set(1,2,3),Set(4,5,6),Set(7,8,9)).transpose - + () } } diff --git a/test/files/run/t3493.scala b/test/files/run/t3493.scala index aafe7a3a4a..b0b7589cfd 100644 --- a/test/files/run/t3493.scala +++ b/test/files/run/t3493.scala @@ -3,7 +3,7 @@ object Test { - + def main(args: Array[String]) { import scala.collection.immutable._ val x = TreeSet("a", "b", "c", "d") @@ -11,5 +11,5 @@ object Test { assert(x2.toString == "TreeSet(a, b, c, d, e)") assert(x2.toString == runtime.ScalaRunTime.stringOf(x2).trim) } - + } diff --git a/test/files/run/t3496.scala b/test/files/run/t3496.scala index e1aa032ab1..80a4e6bd86 100644 --- a/test/files/run/t3496.scala +++ b/test/files/run/t3496.scala @@ -4,12 +4,12 @@ // ticket #3496 object Test { - + def main(args: Array[String]) { val s = Stream.from(1) s.take(5) s.drop(5) s.splitAt(5) } - + } diff --git a/test/files/run/t3502.scala b/test/files/run/t3502.scala index cc78e54c86..9492b2d4d4 100644 --- a/test/files/run/t3502.scala +++ b/test/files/run/t3502.scala @@ -5,7 +5,7 @@ // ticket #3502 object Test { - + object GeneratePrimeFactorsLazy extends (Int => List[Int]) { override def apply(n:Int) = { val s = Stream.range(2, n / 2).filter(n % _ == 0) @@ -13,12 +13,12 @@ object Test { s.headOption.map(x => x :: apply(n / x)).getOrElse(List(n)) } } - + def main(args:Array[String]) { // a prime number //val num = 623456789 val num = 2796203 assert(GeneratePrimeFactorsLazy(num) == List(num)) } - + } diff --git a/test/files/run/t3509.scala b/test/files/run/t3509.scala index 76f8d6016e..7ec150eb01 100644 --- a/test/files/run/t3509.scala +++ b/test/files/run/t3509.scala @@ -1,7 +1,7 @@ object Test { - class Foo(final var i:Int) - + class Foo(final var i:Int) + def main(args : Array[String]) : Unit = { val foo = new Foo(0) foo.i += 1 diff --git a/test/files/run/t3511.scala b/test/files/run/t3511.scala index 30757b1a66..9b4d581462 100644 --- a/test/files/run/t3511.scala +++ b/test/files/run/t3511.scala @@ -6,31 +6,31 @@ import scala.collection.immutable._ // ticket #3511 object Test { - + def main(args: Array[String]) { assert(Stream.from(0).view.force.take(5) == List(0, 1, 2, 3, 4)) - + val s = Stream.from(0) val smap = s.view.map(_ * 2).force.take(5) assert(smap == List(0, 2, 4, 6, 8)) - + val sfilter = s.view.filter(_ % 2 == 0).force.take(5) assert(sfilter == List(0, 2, 4, 6, 8)) - + val sflatmap = s.view.flatMap(n => List(n, n * 2)).force.take(6) assert(sflatmap == List(0, 0, 1, 2, 2, 4)) - + val stakewhile = s.view.takeWhile(_ < 10).force assert(stakewhile == List.range(0, 10)) - + val szip = s.view.zip(s.map(_ / 2)).force.take(5) assert(szip == List((0, 0), (1, 0), (2, 1), (3, 1), (4, 2))) - + val szipall = s.view.zipAll(List(0, 1, 2), 0, 0).force.take(5) assert(szipall == List((0, 0), (1, 1), (2, 2), (3, 0), (4, 0))) - + val spatch = s.view.patch(1, List(5, 5, 5), 5).force.take(5) assert(spatch == List(0, 5, 5, 5, 6)) } - + } diff --git a/test/files/run/t3516.scala b/test/files/run/t3516.scala index aa302ce85a..82a97f27de 100644 --- a/test/files/run/t3516.scala +++ b/test/files/run/t3516.scala @@ -1,7 +1,7 @@ object Test { def mkIterator = (1 to 5).iterator map (x => { println(x) ; x }) def mkInfinite = Iterator continually { println(1) ; 1 } - + def main(args: Array[String]): Unit = { // Stream is strict in its head so we should see 1 from each of them. val s1 = mkIterator.toStream diff --git a/test/files/run/t3518.scala b/test/files/run/t3518.scala index 033cc19548..36ca9daaa2 100644 --- a/test/files/run/t3518.scala +++ b/test/files/run/t3518.scala @@ -4,7 +4,7 @@ object Test { val r3 = 10.0 to 1.0 by -0.5 val r4 = 1.0 until 1.0 by 1.0 val r5 = 1 to 100 by 2 - + def main(args: Array[String]): Unit = { assert(r3 forall (r1 contains _)) assert(r1 forall (r3 contains _)) diff --git a/test/files/run/t3530.scala b/test/files/run/t3530.scala index f6f7fb4229..3fedc66dbe 100644 --- a/test/files/run/t3530.scala +++ b/test/files/run/t3530.scala @@ -5,7 +5,7 @@ object Test { case xs @ List(_*) => "list: " + xs.length case _ => "not a list" }) - + def f2[T](x: List[T]) = println(x match { case List(_, _) => "two" case List(_, _, _) => "three" @@ -21,9 +21,9 @@ object Test { f(Nil) f(List(1,2,3,4,5)) f(null) - + println - + f2(List(1, 2)) f2(List('a', 'b', 'c')) f2(List('a', 'b', 'c', 'd')) diff --git a/test/files/run/t3540.scala b/test/files/run/t3540.scala index 5ffacb5dff..4eb3de780b 100644 --- a/test/files/run/t3540.scala +++ b/test/files/run/t3540.scala @@ -2,6 +2,6 @@ object Test { def main(args: Array[String]): Unit = { assert(List.iterate(List(1,2,3), 4)(_.tail).last.isEmpty) assert(Stream.iterate(Stream(1,2,3), 4)(_.tail).last.isEmpty) - assert(Array.iterate(Array(1,2,3), 4)(_.tail).last.isEmpty) + assert(Array.iterate(Array(1,2,3), 4)(_.tail).last.isEmpty) } } diff --git a/test/files/run/t3563.scala b/test/files/run/t3563.scala index 8abbb60803..2a80ef412a 100644 --- a/test/files/run/t3563.scala +++ b/test/files/run/t3563.scala @@ -5,17 +5,17 @@ // ticket #3563 object Test { - + def main(args: Array[String]) { var sum = 0 val setseq = Set(1, 2, 3, 4).toSeq setseq.map( n => { sum += n; n * n }).head assert(sum == 10) - + sum = 0 val mapseq = Map(1 -> 1, 2 -> 2, 3 -> 3, 4 -> 4).toSeq mapseq.map( n => { sum += n._1; (n._1 + n._1, n._2 * n._2) }).head assert(sum == 10) } - + } diff --git a/test/files/run/t3580.scala b/test/files/run/t3580.scala index 50ff6c4551..ac9f81ab9e 100644 --- a/test/files/run/t3580.scala +++ b/test/files/run/t3580.scala @@ -4,14 +4,14 @@ object Test { - + class Empty extends Traversable[Nothing] { def foreach[U](f: Nothing => U) {} } - + def main(args: Array[String]) { val t = new Empty t.toStream } - + } diff --git a/test/files/run/t3603.scala b/test/files/run/t3603.scala index a89cb7080a..a0821a2a45 100644 --- a/test/files/run/t3603.scala +++ b/test/files/run/t3603.scala @@ -2,17 +2,17 @@ object Test { - + def main(args: Array[String]) { import collection.immutable._ - + val intmap = IntMap(1 -> 1, 2 -> 2) val intres = intmap.map { case (a, b) => (a, b.toString) } assert(intres.isInstanceOf[IntMap[_]]) - + val longmap = LongMap(1L -> 1, 2L -> 2) val longres = longmap.map { case (a, b) => (a, b.toString) } assert(longres.isInstanceOf[LongMap[_]]) } - + } diff --git a/test/files/run/t3613.scala b/test/files/run/t3613.scala index 3763093d30..c3b249571b 100644 --- a/test/files/run/t3613.scala +++ b/test/files/run/t3613.scala @@ -1,7 +1,7 @@ class Boopy { private val s = new Schnuck def observer : PartialFunction[ Any, Unit ] = s.observer - + private class Schnuck extends javax.swing.AbstractListModel { model => val observer : PartialFunction[ Any, Unit ] = { @@ -10,13 +10,13 @@ class Boopy { def getSize = 0 def getElementAt( idx: Int ) : AnyRef = "egal" } - + } object Test { def main(args: Array[String]): Unit = { val x = new Boopy val o = x.observer - o( "Boopy" ) // --> throws runtime error + o( "Boopy" ) // --> throws runtime error } } diff --git a/test/files/run/t3619.scala b/test/files/run/t3619.scala index 3f4c56ea53..46324b4d69 100644 --- a/test/files/run/t3619.scala +++ b/test/files/run/t3619.scala @@ -17,7 +17,7 @@ object Test extends App { } } */ - + new Meh } diff --git a/test/files/run/t363.scala b/test/files/run/t363.scala index c747be2ec9..5f3f30a098 100644 --- a/test/files/run/t363.scala +++ b/test/files/run/t363.scala @@ -3,7 +3,7 @@ object Test { println("I love the smell of (Array[String])Unit in the morning.") } } - + class Test { def kurtz() = "We must kill them. We must incinerate them." } diff --git a/test/files/run/t3647.scala b/test/files/run/t3647.scala index a970e887f6..434a13f414 100644 --- a/test/files/run/t3647.scala +++ b/test/files/run/t3647.scala @@ -13,10 +13,10 @@ object Test { "line4" ).iterator) assert(ps.filter(_ == '\n').size == 3) - + val ps1 = PagedSeq.fromLines(List("Ok").iterator) assert(ps1.filter(_ == '\n').size == 0) - + val eps = PagedSeq.fromLines(List().iterator) assert(eps.filter(_ == '\n').size == 0) } diff --git a/test/files/run/t3714.scala b/test/files/run/t3714.scala index 2d600f97f1..c344b40f1f 100644 --- a/test/files/run/t3714.scala +++ b/test/files/run/t3714.scala @@ -21,7 +21,7 @@ object Test { case BreakImpl(x) => x case _ => -1 } - + def main(args: Array[String]) { val break = BreakImpl(22) // assert(f1(break) == 22) diff --git a/test/files/run/t3719.scala b/test/files/run/t3719.scala index 01dc205545..4649f11bb1 100644 --- a/test/files/run/t3719.scala +++ b/test/files/run/t3719.scala @@ -1,7 +1,7 @@ object Days extends Enumeration { type Day = DayValue val Mon, Tue, Wed, Thu, Fri, Sat, Sun = new DayValue // DayValue - + protected class DayValue extends Val { def isWeekday: Boolean = this match { @@ -21,7 +21,7 @@ object Test extends App { val d: Day = Mon d.toString } - + def nameOfTue(): String = { import Days._ val d: Day = Tue diff --git a/test/files/run/t3822.scala b/test/files/run/t3822.scala index c35804035e..eaf0a145d3 100644 --- a/test/files/run/t3822.scala +++ b/test/files/run/t3822.scala @@ -1,17 +1,17 @@ import scala.collection.{ mutable, immutable, generic } import immutable.ListSet -object Test { +object Test { def main(args: Array[String]): Unit = { val xs = ListSet(-100000 to 100001: _*) - + assert(xs.size == 200002) assert(xs.sum == 100001) - + val ys = ListSet[Int]() val ys1 = (1 to 12).grouped(3).foldLeft(ys)(_ ++ _) val ys2 = (1 to 12).foldLeft(ys)(_ + _) - + assert(ys1 == ys2) } } diff --git a/test/files/run/t3829.scala b/test/files/run/t3829.scala index 780a6a95b7..e3d8c56882 100644 --- a/test/files/run/t3829.scala +++ b/test/files/run/t3829.scala @@ -1,11 +1,11 @@ // ticket #3829 object Test { import collection.{ mutable, immutable } - + def main(args: Array[String]) { val map = immutable.Map(1 -> 2, 3 -> 4) assert(map.get(0) == None) - + // Since r24255 defaultMap.get(x) returns None rather than // using the default, so these mostly use apply. val defmap = map.withDefaultValue(-1) @@ -19,10 +19,10 @@ object Test { assert((defmap - 1)(0) == -1) assert((defmap - 1)(1) == -1) assert((defmap - 1)(3) == 4) - + val mutmap = mutable.Map(1 -> 2, 2 -> 3) assert(mutmap.get(0) == None) - + val defmutmap = mutmap.withDefaultValue(-1) assert(defmutmap(0) == -1) assert(defmutmap(3) == -1) @@ -36,5 +36,5 @@ object Test { assert(defmutmap(1) == 2) assert(mutmap(1) == 2) } - + } diff --git a/test/files/run/t3855.scala b/test/files/run/t3855.scala index 32dfb1e23d..e55714201f 100644 --- a/test/files/run/t3855.scala +++ b/test/files/run/t3855.scala @@ -1,7 +1,7 @@ object Test { def byval[A](a: => A) = a def closure[A](f: () => A) = f() - + def f1(s: String) = { var n = try { s.toInt } catch { case _ => 1 } byval(n) diff --git a/test/files/run/t3877.scala b/test/files/run/t3877.scala index 5710e982a0..ce1e9283a7 100644 --- a/test/files/run/t3877.scala +++ b/test/files/run/t3877.scala @@ -11,7 +11,7 @@ object Test { println("test1: " + d) } } - + def test2 { var d = 2 var i = 0 @@ -25,7 +25,7 @@ object Test { return } } - + def test3 { var d = 2 var i = 0 @@ -34,9 +34,9 @@ object Test { d = b i += 1 println("test3: " + d) - } while (d < LIMIT && i < LIMIT) + } while (d < LIMIT && i < LIMIT) } - + def test4 { var d = 2 var i = 0 @@ -47,9 +47,9 @@ object Test { println("test4: " + d) if (d >= LIMIT || i >= LIMIT) return - } while (true) + } while (true) } - + def test5 { var d = 2 var i = 0 @@ -58,7 +58,7 @@ object Test { d = b i += 1 println("test5.1: " + d) - + var e = 2 var j = 0 while (e < LIMIT && j < LIMIT) { @@ -69,7 +69,7 @@ object Test { } } } - + def main(args: Array[String]) { test1 diff --git a/test/files/run/t3887.scala b/test/files/run/t3887.scala index 16ce983efc..81fa7a917e 100644 --- a/test/files/run/t3887.scala +++ b/test/files/run/t3887.scala @@ -13,4 +13,4 @@ object Test { val option1: (Int, String) = (1, "abc") -} +} diff --git a/test/files/run/t3888.scala b/test/files/run/t3888.scala index ecdf87e925..e0f1453b1d 100644 --- a/test/files/run/t3888.scala +++ b/test/files/run/t3888.scala @@ -3,13 +3,13 @@ object Test { val T1 = new P private[this] val T2 = T1 - def m1 = + def m1 = (1, 2) match { case T1 => true case _ => false } - def m2 = + def m2 = (1, 2) match { case T2 => true case _ => false diff --git a/test/files/run/t3897/J_2.java b/test/files/run/t3897/J_2.java index a4c9a98fb1..178412dc92 100644 --- a/test/files/run/t3897/J_2.java +++ b/test/files/run/t3897/J_2.java @@ -7,7 +7,7 @@ public class J_2 { String name = fields[i].getName(); if (name.length() >= 7 && name.substring(0, 7).equals("bitmap$")) { } else System.out.println("(" + name + "," + fields[i].getGenericType() + ")"); - } + } } public void f2(Class clazz) { Method[] methods = clazz.getDeclaredMethods(); @@ -15,7 +15,7 @@ public class J_2 { String name = methods[i].getName(); if (name.length() >= 7 && name.substring(0, 7).equals("bitmap$")) { } else System.out.println("(" + name + "," + methods[i].getGenericReturnType() + ")"); - } + } } public void javaRun() { diff --git a/test/files/run/t3897/a_2.scala b/test/files/run/t3897/a_2.scala index 7a161fcbe4..4d9e59ef05 100644 --- a/test/files/run/t3897/a_2.scala +++ b/test/files/run/t3897/a_2.scala @@ -1,12 +1,12 @@ object Test { def f1(clazz: Class[_]) = ( - clazz.getDeclaredFields.toList + clazz.getDeclaredFields.toList . filterNot (_.getName contains "bitmap$") . map (f => (f.getName, f.getGenericType)) . foreach (println) ) def f2(clazz: Class[_]) = ( - clazz.getDeclaredMethods.toList + clazz.getDeclaredMethods.toList . filterNot (_.getName contains "bitmap$") . map (f => (f.getName, f.getGenericReturnType)) . foreach (println) @@ -17,7 +17,7 @@ object Test { f2(classOf[One]) f1(classOf[Two]) f2(classOf[Two]) - + new J_2().javaRun } } diff --git a/test/files/run/t3932.scala b/test/files/run/t3932.scala index f577ef8315..51fc16d6ea 100644 --- a/test/files/run/t3932.scala +++ b/test/files/run/t3932.scala @@ -23,10 +23,10 @@ object Test { def main(args: Array[String]): Unit = { println(O1.g1) println(O1.g2) - + println(O2.g1) println(O2.g2) - + val o3 = new O3() println(o3.g1) println(o3.g2) diff --git a/test/files/run/t3964.scala b/test/files/run/t3964.scala index df1eb716e8..80ba361a20 100644 --- a/test/files/run/t3964.scala +++ b/test/files/run/t3964.scala @@ -1,13 +1,13 @@ object Test { - class Base + class Base object Bob extends Base class Foo { def bippy = 42 } class Oof { def bippy = -21 } - + // I am more specific than you implicit def f1(x: Bob.type): Foo = new Foo implicit def f2(x: Base): Oof = new Oof - + def main(args: Array[String]): Unit = { // this would of course print an unambiguous 42 println(Bob.bippy) diff --git a/test/files/run/t3970.scala b/test/files/run/t3970.scala index 35b5ce6e1b..f8c763bc85 100644 --- a/test/files/run/t3970.scala +++ b/test/files/run/t3970.scala @@ -9,11 +9,11 @@ object Test { def main(args: Array[String]) { val dl = DoubleLinkedList[Int]() dl.remove() - + val dl2 = DoubleLinkedList[Int](1, 2, 3) dl2.next.remove() assert(dl2 == DoubleLinkedList(1, 3)) - + val dl3 = DoubleLinkedList[Int](1, 2, 3) assert(dl3.drop(1) == DoubleLinkedList(2, 3)) assert(dl3.drop(1).prev == null) diff --git a/test/files/run/t3980.scala b/test/files/run/t3980.scala index c140176ce4..4e693eba9b 100644 --- a/test/files/run/t3980.scala +++ b/test/files/run/t3980.scala @@ -2,7 +2,7 @@ object A { def run1 { lazy val x: Unit = {(); println("once")} x - x + x } def run2 { lazy val y: Int = 2 diff --git a/test/files/run/t3984.scala b/test/files/run/t3984.scala index 0747b0ee25..9a2e00a2a8 100644 --- a/test/files/run/t3984.scala +++ b/test/files/run/t3984.scala @@ -36,7 +36,7 @@ object MapBug { im = im + ((ih,ih)) mm = mm + ((ih,ih)) } - assert(im == mm) + assert(im == mm) val x = IH(6,4) im = im - x mm = mm - x diff --git a/test/files/run/t4013.scala b/test/files/run/t4013.scala index 7060559317..da7fbc5b3f 100644 --- a/test/files/run/t4013.scala +++ b/test/files/run/t4013.scala @@ -5,12 +5,12 @@ trait Base[B] { } -class Suba[@specialized B](override val data: Array[B]) extends Base[B] { +class Suba[@specialized B](override val data: Array[B]) extends Base[B] { assert(data != null) } -class Subopt[@specialized B](override val data: Option[B]) extends Base[B] { +class Subopt[@specialized B](override val data: Option[B]) extends Base[B] { assert(data != null) } diff --git a/test/files/run/t4013b.scala b/test/files/run/t4013b.scala index 1262e261f5..f17eaea3d3 100644 --- a/test/files/run/t4013b.scala +++ b/test/files/run/t4013b.scala @@ -8,7 +8,7 @@ trait Base[B] { class M[@specialized(Int) A] -class Sub3[@specialized(Int) B](override val data: M[B]) extends Base[B] { +class Sub3[@specialized(Int) B](override val data: M[B]) extends Base[B] { assert(data != null) } diff --git a/test/files/run/t4024.scala b/test/files/run/t4024.scala index 4ab383ebc3..ef768beb99 100644 --- a/test/files/run/t4024.scala +++ b/test/files/run/t4024.scala @@ -1,9 +1,9 @@ object Test extends App { - val x = "abc" + val x = "abc" val m = x.getClass.getMethod("toString") - + assert(m.invoke(x, (Nil: List[AnyRef]): _*) == "abc") } diff --git a/test/files/run/t4054.scala b/test/files/run/t4054.scala index 83a58ef97c..8f1f685854 100644 --- a/test/files/run/t4054.scala +++ b/test/files/run/t4054.scala @@ -9,7 +9,7 @@ object Test { def main(args: Array[String]) { val it = Iterator.from(1).map(n => n * n).scanLeft(0)(_+_) - + assert(it.next == 0) assert(it.next == 1) assert(it.next == 5) diff --git a/test/files/run/t4062.scala b/test/files/run/t4062.scala index f5478e7593..6a5aea5b47 100644 --- a/test/files/run/t4062.scala +++ b/test/files/run/t4062.scala @@ -1,7 +1,7 @@ class A(val f : String) class B(f: String) extends A(f) { - def foo(x: String) = x match { + def foo(x: String) = x match { case `f` => true case _ => false } diff --git a/test/files/run/t4072.scala b/test/files/run/t4072.scala index 371b8ccd5f..872072a4ce 100644 --- a/test/files/run/t4072.scala +++ b/test/files/run/t4072.scala @@ -2,11 +2,11 @@ import scala.tools.nsc._ object Test { class DryRun { - val compiler = new Global(new Settings()) { + val compiler = new Global(new Settings()) { lazy val test1 = new AnyRef } } - + def main(args: Array[String]) { new DryRun().compiler.test1 } diff --git a/test/files/run/t408.scala b/test/files/run/t408.scala index 9e51e881ed..4d3dcbcb84 100644 --- a/test/files/run/t408.scala +++ b/test/files/run/t408.scala @@ -2,7 +2,7 @@ object Test { val a = scala.collection.immutable.Set.empty ++ (0 to 100000) val b = scala.collection.immutable.Set.empty ++ (0 to 100000) - + def main(args: Array[String]): Unit = { a -- b a -- b diff --git a/test/files/run/t4110.scala b/test/files/run/t4110.scala index a42646ce52..4bd377b73e 100644 --- a/test/files/run/t4110.scala +++ b/test/files/run/t4110.scala @@ -3,7 +3,7 @@ object Test extends App { trait A trait B - + inferredType(new A with B) val name = new A with B diff --git a/test/files/run/t4119/J.java b/test/files/run/t4119/J.java index ee65d33e22..42508993ea 100644 --- a/test/files/run/t4119/J.java +++ b/test/files/run/t4119/J.java @@ -1,6 +1,6 @@ package foo.bar; -public abstract class J { +public abstract class J { protected void foo(J j) { return; } diff --git a/test/files/run/t4119/S.scala b/test/files/run/t4119/S.scala index d6ae5f1b87..e5e3db5da3 100644 --- a/test/files/run/t4119/S.scala +++ b/test/files/run/t4119/S.scala @@ -1,6 +1,6 @@ class S extends foo.bar.J { sss => - + val fn = () => { foo(S.this) } diff --git a/test/files/run/t4122.scala b/test/files/run/t4122.scala index 5ff570c009..7ead2b7742 100644 --- a/test/files/run/t4122.scala +++ b/test/files/run/t4122.scala @@ -4,7 +4,7 @@ object Test { val sw3 = Seq('a', 'b') val sw4 = "ab".toList val all = List(sw, sw2, sw3, sw4) - + def main(args: Array[String]): Unit = { for (s1 <- all ; s2 <- all) { assert(s1 == s2, s1 + " != " + s2) diff --git a/test/files/run/t4148.scala b/test/files/run/t4148.scala index a7d181268d..0739403594 100644 --- a/test/files/run/t4148.scala +++ b/test/files/run/t4148.scala @@ -2,7 +2,7 @@ object Test { val x1 = try { "aaa".asInstanceOf[Int] } catch { case _ => "cce1" } val x2 = try { (5: Any).asInstanceOf[Int] } catch { case _ => "cce2" } val x3 = try { (new java.lang.Short(100.toShort).asInstanceOf[Int]) } catch { case _ => "cce3" } - + def main(args: Array[String]): Unit = { List(x1, x2, x3) foreach println } diff --git a/test/files/run/t4238/J_1.java b/test/files/run/t4238/J_1.java index 47a9c21000..21a4b182ad 100644 --- a/test/files/run/t4238/J_1.java +++ b/test/files/run/t4238/J_1.java @@ -3,14 +3,14 @@ import scala.*; class J_1 { scala.collection.mutable.HashMap map = new scala.collection.mutable.HashMap(); - + Function1, Integer> f = new scala.runtime.AbstractFunction1, Integer>() { public Integer apply(Tuple2 s) { return s._1().length(); } }; - + scala.collection.Seq counts = map.groupBy(f).keys().toList(); } diff --git a/test/files/run/t4288.scala b/test/files/run/t4288.scala index 4e7b366f60..eafd2808f1 100644 --- a/test/files/run/t4288.scala +++ b/test/files/run/t4288.scala @@ -6,7 +6,7 @@ object Test { def f5 = (1 to 9).toArray.slice(-5, -1) def f6 = (1 to 9).toStream.slice(-5, -1) def f7 = (1 to 9).slice(-5, -1) - + def main(args: Array[String]): Unit = { List[Traversable[Int]](f1, f2, f3, f4, f5, f6, f7) foreach (x => assert(x.isEmpty, x)) } diff --git a/test/files/run/t4294.scala b/test/files/run/t4294.scala index 50c83ac819..fafaf1d8ef 100644 --- a/test/files/run/t4294.scala +++ b/test/files/run/t4294.scala @@ -1,7 +1,7 @@ object Test { def main(args: Array[String]) { (Stream.from(1).collect{case x if x > 5000000 => x}: Stream[Int]) - + assert((Stream from 1 take 10 collect { case x if x <= 3 => x*x }).sum == 14) } } diff --git a/test/files/run/t4317/S_3.scala b/test/files/run/t4317/S_3.scala index ce8e2330e3..dd04ea31ef 100644 --- a/test/files/run/t4317/S_3.scala +++ b/test/files/run/t4317/S_3.scala @@ -1,4 +1,4 @@ -object Test { +object Test { def main(args: Array[String]): Unit = { val j = new J_2() println(j.bar1()) diff --git a/test/files/run/t4387.scala b/test/files/run/t4387.scala index f51c9b0572..68cbe97d08 100644 --- a/test/files/run/t4387.scala +++ b/test/files/run/t4387.scala @@ -1,11 +1,11 @@ object Test { import xml.XML.loadString def mkElem(arg: String) = - + val x1 = mkElem("5") val x2 = mkElem("50") - def main(args: Array[String]): Unit = { + def main(args: Array[String]): Unit = { assert(x1 == loadString("" + x1)) assert(x2 != loadString("" + x1)) } diff --git a/test/files/run/t4396.scala b/test/files/run/t4396.scala index d67eaa378e..ca143165b7 100644 --- a/test/files/run/t4396.scala +++ b/test/files/run/t4396.scala @@ -1,4 +1,4 @@ -// #43896 +// #43896 trait M extends DelayedInit { def delayedInit(body : => Unit) { println("hallo") diff --git a/test/files/run/t4426.scala b/test/files/run/t4426.scala index 1cbd42da25..95759444d6 100644 --- a/test/files/run/t4426.scala +++ b/test/files/run/t4426.scala @@ -5,7 +5,7 @@ object Test { val settings = new Settings() settings.classpath.value = System.getProperty("java.class.path") - object cc extends Global(settings) { + object cc extends Global(settings) { object dummy override def computePluginPhases() = { @@ -16,9 +16,9 @@ object Test { new cc.Run () } - + def main(args: Array[String]): Unit = { - + } } diff --git a/test/files/run/t4461.scala b/test/files/run/t4461.scala index d1f80a6012..99da122f6b 100644 --- a/test/files/run/t4461.scala +++ b/test/files/run/t4461.scala @@ -9,7 +9,7 @@ object Test { buf.subscribe(new Subscriber[Message[Int], ObservableBuffer[Int]] { def notify(pub: ObservableBuffer[Int], event: Message[Int]) = println(event) }) - + buf += 1 // works buf ++= Array(2) // works buf ++= ArrayBuffer(3, 4) // works diff --git a/test/files/run/t4532.check b/test/files/run/t4532.check index 018bbf2fa3..47a9809248 100644 --- a/test/files/run/t4532.check +++ b/test/files/run/t4532.check @@ -1,7 +1,7 @@ Type in expressions to have them evaluated. Type :help for more information. -scala> +scala> scala> object Bippy { class Dingus ; object Bop } defined module Bippy @@ -10,6 +10,6 @@ scala> :javap Bippy.Dingus Compiled from ""public class Bippy$Dingus extends java.lang.Object implements scala.ScalaObject{ public Bippy$Dingus();} scala> :javap Bippy.Bop Compiled from ""public final class Bippy$Bop$ extends java.lang.Object implements scala.ScalaObject{ public static final Bippy$Bop$ MODULE$; public static {}; public Bippy$Bop$();} -scala> +scala> -scala> +scala> diff --git a/test/files/run/t4532.scala b/test/files/run/t4532.scala index 2e100f2cc7..0dabd2dca4 100644 --- a/test/files/run/t4532.scala +++ b/test/files/run/t4532.scala @@ -2,13 +2,13 @@ import scala.tools.partest.ReplTest import scala.tools.util.Javap object Test extends ReplTest { - + // ugh, windows def expectedOutput = """Type in expressions to have them evaluated. Type :help for more information. -scala> +scala> scala> object Bippy { class Dingus ; object Bop } defined module Bippy @@ -17,12 +17,12 @@ scala> :javap Bippy.Dingus Compiled from ""public class Bippy$Dingus extends java.lang.Object implements scala.ScalaObject{ public Bippy$Dingus();} scala> :javap Bippy.Bop Compiled from ""public final class Bippy$Bop$ extends java.lang.Object implements scala.ScalaObject{ public static final Bippy$Bop$ MODULE$; public static {}; public Bippy$Bop$();} -scala> +scala> -scala> +scala> """ - override def eval() = + override def eval() = if (Javap.isAvailable()) super.eval() else expectedOutput.lines diff --git a/test/files/run/t4535.scala b/test/files/run/t4535.scala index 91c13a28cd..eba79431c9 100644 --- a/test/files/run/t4535.scala +++ b/test/files/run/t4535.scala @@ -5,26 +5,26 @@ import collection._ // #4535 object Test { - + def main(args: Array[String]) { val as = new mutable.ArrayStack[Int] as push 1 as push 2 as push 3 println(as.reverse) - + as push 4 as push 5 as push 6 println(as.reverse) - + println(as map { x => x }) - + for (i <- 0 until 100) { as push i assert(as == as.map(x => x)) assert(as == as.reverse.reverse) } } - + } diff --git a/test/files/run/t4560.scala b/test/files/run/t4560.scala index f809e67898..1392077e46 100644 --- a/test/files/run/t4560.scala +++ b/test/files/run/t4560.scala @@ -35,5 +35,5 @@ object Test extends A with B { } } -object Test2 extends A2 with B2 +object Test2 extends A2 with B2 diff --git a/test/files/run/t4570.scala b/test/files/run/t4570.scala index 5e1a20c52d..5408caf6db 100644 --- a/test/files/run/t4570.scala +++ b/test/files/run/t4570.scala @@ -1,8 +1,8 @@ object Test extends Enumeration { val foo = Value def bar = withName("foo") - + def main(args: Array[String]): Unit = { - values foreach println + values foreach println } } diff --git a/test/files/run/t4608.scala b/test/files/run/t4608.scala index a25d2fea05..3601adc275 100644 --- a/test/files/run/t4608.scala +++ b/test/files/run/t4608.scala @@ -3,9 +3,9 @@ // #4608 object Test { - + def main(args: Array[String]) { ((1 to 100) sliding 10).toList.par.map{_.map{i => i * i}}.flatten } - + } diff --git a/test/files/run/t4617.scala b/test/files/run/t4617.scala index 2fea5e29ec..3a877c1915 100644 --- a/test/files/run/t4617.scala +++ b/test/files/run/t4617.scala @@ -3,7 +3,7 @@ object Test { def f2 = { lazy val d = 4D lazy val f = 4f - + def bar = "Str " + (d + f) bar } diff --git a/test/files/run/t4656.scala b/test/files/run/t4656.scala index 4f3d189c8f..ab3e3cf53d 100644 --- a/test/files/run/t4656.scala +++ b/test/files/run/t4656.scala @@ -6,7 +6,7 @@ object Test { buf prependToList List(4, 5, 6) l } - + def main(args: Array[String]): Unit = { println(f) } diff --git a/test/files/run/t4671.check b/test/files/run/t4671.check index 797c0d8905..4699818cd4 100644 --- a/test/files/run/t4671.check +++ b/test/files/run/t4671.check @@ -10,7 +10,7 @@ s: scala.io.BufferedSource = non-empty iterator scala> println(s.getLines.mkString("\n")) import scala.tools.partest.ReplTest -object Test extends ReplTest { +object Test extends ReplTest { // My god...it's full of quines def code = """ object o { val file = sys.props("partest.cwd") + "/t4671.scala" } @@ -30,7 +30,7 @@ s: scala.io.BufferedSource = non-empty iterator scala> println(s.mkString("")) import scala.tools.partest.ReplTest -object Test extends ReplTest { +object Test extends ReplTest { // My god...it's full of quines def code = """ object o { val file = sys.props("partest.cwd") + "/t4671.scala" } diff --git a/test/files/run/t4671.scala b/test/files/run/t4671.scala index 6170104c33..aba0138aad 100644 --- a/test/files/run/t4671.scala +++ b/test/files/run/t4671.scala @@ -1,6 +1,6 @@ import scala.tools.partest.ReplTest -object Test extends ReplTest { +object Test extends ReplTest { // My god...it's full of quines def code = """ object o { val file = sys.props("partest.cwd") + "/t4671.scala" } diff --git a/test/files/run/t4680.scala b/test/files/run/t4680.scala index d5c8d0e7af..88611df7ae 100644 --- a/test/files/run/t4680.scala +++ b/test/files/run/t4680.scala @@ -43,13 +43,13 @@ class E() extends D() { object Test { def p(msg: String) = println("\n\n// " + msg) - + def main(args: Array[String]) { p("new C { }") new C { } p("new C { 5 }") new C { 5 } - + p("new D()") new D() p("new D() { }") diff --git a/test/files/run/t4697.scala b/test/files/run/t4697.scala index 95592172e0..728d095ff8 100644 --- a/test/files/run/t4697.scala +++ b/test/files/run/t4697.scala @@ -1,7 +1,7 @@ object Test { var st = Stream(0) for (i <- 1 to 10000) st = i +: st - + def main(args: Array[String]): Unit = { println(st.take(10000).sum) } diff --git a/test/files/run/t4752.scala b/test/files/run/t4752.scala index 3d5c166a7a..2a9fc5361f 100644 --- a/test/files/run/t4752.scala +++ b/test/files/run/t4752.scala @@ -2,8 +2,8 @@ object Test { object Bippy { case object Dingus } - - def main(args: Array[String]): Unit = { + + def main(args: Array[String]): Unit = { assert(None.## == "None".##, None) assert(Test.Bippy.Dingus.## == "Dingus".##, Test.Bippy.Dingus) } diff --git a/test/files/run/t4753.scala b/test/files/run/t4753.scala index cfb252cbe5..98f3e92678 100644 --- a/test/files/run/t4753.scala +++ b/test/files/run/t4753.scala @@ -1,4 +1,4 @@ -trait A { +trait A { val actualType: Class[_] } trait B extends A { diff --git a/test/files/run/t4761.scala b/test/files/run/t4761.scala index 205798b00e..82818379f5 100644 --- a/test/files/run/t4761.scala +++ b/test/files/run/t4761.scala @@ -7,7 +7,7 @@ object Test { val gs = for (x <- (1 to 5)) yield { if (x % 2 == 0) List(1).seq else List(1).par } println(gs.flatten) println(gs.transpose) - + val s = Stream(Vector(1).par, Vector(2).par) println(s.flatten.toList) println(s.transpose.map(_.toList).toList) diff --git a/test/files/run/t4894.scala b/test/files/run/t4894.scala index 2b70da141d..aa3b4340af 100644 --- a/test/files/run/t4894.scala +++ b/test/files/run/t4894.scala @@ -4,24 +4,24 @@ object Test { - + def main(args: Array[String]) { import collection._ val hs = mutable.HashSet[Int]() hs ++= 1 to 10 hs --= 1 to 10 - + val phs = parallel.mutable.ParHashSet[Int]() phs ++= 1 to 10 for (i <- 1 to 10) assert(phs(i)) phs --= 1 to 10 assert(phs.isEmpty) - + val phm = parallel.mutable.ParHashMap[Int, Int]() phm ++= ((1 to 10) zip (1 to 10)) for (i <- 1 to 10) assert(phm(i) == i) phm --= 1 to 10 assert(phm.isEmpty) } - + } diff --git a/test/files/run/t4895.scala b/test/files/run/t4895.scala index 14f6761209..c6e6cc18b4 100644 --- a/test/files/run/t4895.scala +++ b/test/files/run/t4895.scala @@ -3,18 +3,18 @@ object Test { - + def checkPar(sz: Int) { import collection._ val hs = mutable.HashSet[Int]() ++ (1 to sz) assert(hs.par.map(_ + 1).seq.toSeq.sorted == (2 to (sz + 1))) } - + def main(args: Array[String]) { for (i <- 0 until 100) checkPar(i) for (i <- 100 until 1000 by 50) checkPar(i) for (i <- 1000 until 10000 by 500) checkPar(i) for (i <- 10000 until 100000 by 5000) checkPar(i) } - + } diff --git a/test/files/run/t576.scala b/test/files/run/t576.scala index 2fc929f325..dc09d8dc98 100644 --- a/test/files/run/t576.scala +++ b/test/files/run/t576.scala @@ -12,7 +12,7 @@ object Dingus { object Test { val x1 = new A val x2 = new A - + val x3 = new { self => override def equals(other : Any) = other match { case that: self.type => true @@ -35,11 +35,11 @@ object Test { assert(x1 != x2) assert(x1 != ()) assert(x2 != x1) - + assert(x3 == x3) assert(x3 != x2) assert(x2 != x3) - + List(x1, x2, x3, x4, Dingus) map x4.f foreach println } } \ No newline at end of file diff --git a/test/files/run/t603.scala b/test/files/run/t603.scala index 361cef1f41..b8825c933b 100644 --- a/test/files/run/t603.scala +++ b/test/files/run/t603.scala @@ -22,7 +22,7 @@ object forceDelay { object Test { import forceDelay._ - + def main(args: Array[String]) = { val s: Susp[Int] = delay { Console.println("evaluating..."); 3 } Console.println("s = " + s) diff --git a/test/files/run/t744.scala b/test/files/run/t744.scala index 4895e9baa0..d5e9f6df34 100644 --- a/test/files/run/t744.scala +++ b/test/files/run/t744.scala @@ -5,7 +5,7 @@ trait Linked { } } object Test { - class Test extends Linked { + class Test extends Linked { trait FileImpl extends super.FileImpl { // val x: int = 1 } diff --git a/test/files/run/t874.scala b/test/files/run/t874.scala index d83014651b..41d124f728 100644 --- a/test/files/run/t874.scala +++ b/test/files/run/t874.scala @@ -5,7 +5,7 @@ object Test { } U("xyz")(2) } - class Mix extends Base { + class Mix extends Base { case class U[A](x1: A)(x2: Int) { Console.println("U created with "+x1+" and "+x2) } diff --git a/test/files/run/t920.scala b/test/files/run/t920.scala index 6a7f122d55..1e12e6ba87 100644 --- a/test/files/run/t920.scala +++ b/test/files/run/t920.scala @@ -7,7 +7,7 @@ object Test { trait Foo extends Test.Foo0 { def foo : B.this.type = B.this; } - class baz extends Baz with Foo { + class baz extends Baz with Foo { override def toString = "baz" } Console.println(new baz); diff --git a/test/files/run/tailcalls.scala b/test/files/run/tailcalls.scala index 77b123f5ce..04a1a8ba19 100644 --- a/test/files/run/tailcalls.scala +++ b/test/files/run/tailcalls.scala @@ -194,10 +194,10 @@ object FancyTailCalls { } object PolyObject extends App { - def tramp[A](x: Int): Int = + def tramp[A](x: Int): Int = if (x > 0) tramp[A](x - 1) - else + else 0 } @@ -233,7 +233,7 @@ class NonTailCall { if (n == 0) 0 else f2(n - 1) } - + } //############################################################################ @@ -273,7 +273,7 @@ object Test { } println } - + def check_overflow(name: String, closure: => Int) { print("test " + name) try { @@ -367,7 +367,7 @@ object Test { check_success("TailCall.g3", TailCall.g3(max, max, Nil), 0) check_success("TailCall.h1", TailCall.h1(max, max ), 0) println - + val NonTailCall = new NonTailCall check_success("NonTailCall.f1", NonTailCall.f1(2), 0) check_overflow("NonTailCall.f2", NonTailCall.f2(max)) @@ -382,17 +382,17 @@ object Test { } // testing explicit tailcalls. - + import scala.util.control.TailCalls._ def isEven(xs: List[Int]): TailRec[Boolean] = if (xs.isEmpty) done(true) else tailcall(isOdd(xs.tail)) def isOdd(xs: List[Int]): TailRec[Boolean] = - if (xs.isEmpty) done(false) else tailcall(isEven(xs.tail)) + if (xs.isEmpty) done(false) else tailcall(isEven(xs.tail)) assert(isEven((1 to 100000).toList).result) - + } //############################################################################ diff --git a/test/files/run/takeAndDrop.scala b/test/files/run/takeAndDrop.scala index 8d2dff0bfa..6e87838e11 100644 --- a/test/files/run/takeAndDrop.scala +++ b/test/files/run/takeAndDrop.scala @@ -1,9 +1,9 @@ -object Test { +object Test { def main(args: Array[String]): Unit = { val range = 1 to 10 val target = (3 to 8).toList val confirm = (xs: Seq[Int]) => assert(xs.toList == target, xs) - + confirm(range drop 2 dropRight 2) confirm(range drop 1 dropRight 1 drop 1 dropRight 1) confirm(range take 8 drop 2) diff --git a/test/files/run/tcpoly_monads.scala b/test/files/run/tcpoly_monads.scala index e437010481..cffbcc963b 100644 --- a/test/files/run/tcpoly_monads.scala +++ b/test/files/run/tcpoly_monads.scala @@ -4,15 +4,15 @@ trait Monads { * (>>=) :: m a -> (a -> m b) -> m b * return :: a -> m a * - * MonadTC encodes the above Haskell type class, + * MonadTC encodes the above Haskell type class, * an instance of MonadTC corresponds to a method dictionary. * (see http://lampwww.epfl.ch/~odersky/talks/wg2.8-boston06.pdf) * * Note that the identity (`this') of the method dictionary does not really correspond - * to the instance of m[x] (`self') that is `wrapped': e.g., unit does not use `self' (which + * to the instance of m[x] (`self') that is `wrapped': e.g., unit does not use `self' (which * corresponds to the argument of the implicit conversion that encodes an instance of this type class) */ - trait MonadTC[m[x], a] { + trait MonadTC[m[x], a] { def unit[a](orig: a): m[a] // >>='s first argument comes from the implicit definition constructing this "method dictionary" @@ -27,7 +27,7 @@ trait Monads { */ trait OptionMonad extends Monads { // this implicit method encodes the Monad type class instance for Option - implicit def OptionInstOfMonad[a](self: Option[a]): MonadTC[Option, a] + implicit def OptionInstOfMonad[a](self: Option[a]): MonadTC[Option, a] = new MonadTC[Option, a] { def unit[a](orig: a) = Some(orig) def >>=[b](fun: a => Option[b]): Option[b] = self match { diff --git a/test/files/run/tcpoly_parseridioms.scala b/test/files/run/tcpoly_parseridioms.scala index 741be05af1..634240e44d 100644 --- a/test/files/run/tcpoly_parseridioms.scala +++ b/test/files/run/tcpoly_parseridioms.scala @@ -1,10 +1,10 @@ trait Parsers { type Input = List[Char] - + sealed class ParseResult[+t](val next: Input) - case class Success[+t](override val next: Input, result: t) extends ParseResult[t](next) + case class Success[+t](override val next: Input, result: t) extends ParseResult[t](next) case class Failure(override val next: Input, msg: String) extends ParseResult[Nothing](next) - + abstract class Parser[+t] { def apply(in: Input): ParseResult[t] } @@ -16,7 +16,7 @@ trait Parsers { case Success(next2, y) => Success(next2, Pair(x,y)) case Failure(_, msg) => Failure(in, msg) } - case Failure(_, msg) => Failure(in, msg) + case Failure(_, msg) => Failure(in, msg) } } @@ -38,20 +38,20 @@ trait Parsers { case Failure(n, msg) => Failure(n, msg) } } - + def accept[T](c: Char, r: T): Parser[T] = new Parser[T] { def apply(in: Input) = in match { case c2 :: n if c2 == c => Success(n, r) case n => Failure(n, "expected "+c+" at the head of "+n) } } - - def apply_++[s, tt](fun: Parser[s => tt], arg: Parser[s]): Parser[tt] = lift[Pair[s=>tt, s], tt]({case Pair(f, a) => f(a)})(sq(fun, arg)) - + + def apply_++[s, tt](fun: Parser[s => tt], arg: Parser[s]): Parser[tt] = lift[Pair[s=>tt, s], tt]({case Pair(f, a) => f(a)})(sq(fun, arg)) + def success[u](v: u): Parser[u] = new Parser[u] { def apply(in: Input) = Success(in, v) } - + } trait Idioms { @@ -61,21 +61,21 @@ trait Idioms { def pureMethod[a](name: String, x: a): idi[a] = pure(x) // hack for Mirrors: allow passing of method names } - class IdiomaticTarget[idi[x], idiom <: Idiom[idi], s](i: idiom, tgt: s) { + class IdiomaticTarget[idi[x], idiom <: Idiom[idi], s](i: idiom, tgt: s) { def dot [t](fun: s => t, name: String) = new IdiomaticApp2[idi, idiom, t](i, i.liftedApply(i.pureMethod(name, fun))(i.pure(tgt))) } // TODO: `.` --> java.lang.ClassFormatError: Illegal method name "." in class Idioms$Id$ - class IdiomaticFunction[idi[x], idiom <: Idiom[idi], s, t](i: idiom, fun: s => t) { + class IdiomaticFunction[idi[x], idiom <: Idiom[idi], s, t](i: idiom, fun: s => t) { def <| (a: idi[s]) = new IdiomaticApp[idi, idiom, t](i, i.liftedApply(i.pure(fun))(a)) } class IdiomaticApp[idi[x], idiom <: Idiom[idi], x](i: idiom, a: idi[x]) { // where x <: s=>t -- TODO can this be expressed without generalised constraints? def <> [s, t](b: idi[s]) = new IdiomaticApp[idi, idiom, t](i, i.liftedApply(a.asInstanceOf[idi[s=>t]])(b)) - + def |> : idi[x] = a } - + class IdiomaticApp2[idi[x], idiom <: Idiom[idi], x](i: idiom, a: idi[x]) extends IdiomaticApp[idi, idiom, x](i, a) { def <| [s, t](b: idi[s]) = <>[s,t](b) } @@ -86,22 +86,22 @@ trait ParserIdioms extends Parsers with Idioms { def liftedApply[s, t](fun: Parser[s => t])(arg: Parser[s]): Parser[t] = apply_++(fun, arg) def pure[a](x: a): Parser[a] = success(x) } - - implicit def parserIdiomFun[s, t](fun: s=>t): IdiomaticFunction[Parser, ParserIdiom.type, s, t] = + + implicit def parserIdiomFun[s, t](fun: s=>t): IdiomaticFunction[Parser, ParserIdiom.type, s, t] = new IdiomaticFunction[Parser, ParserIdiom.type, s, t](ParserIdiom, fun) - implicit def parserIdiomTgt[s](tgt: s): IdiomaticTarget[Parser, ParserIdiom.type, s] = + implicit def parserIdiomTgt[s](tgt: s): IdiomaticTarget[Parser, ParserIdiom.type, s] = new IdiomaticTarget[Parser, ParserIdiom.type, s](ParserIdiom, tgt) - + trait Expr case class Plus(a: Int, b: Int) extends Expr - + def num = or(accept('0', 0), or(accept('1', 1),accept('2', 2))) - - // TODO: how can parserIdiom(curry2(_)) be omitted? + + // TODO: how can parserIdiom(curry2(_)) be omitted? def expr: Parser[Expr] = parserIdiomFun(curry2(Plus)) <| num <> num |> - + implicit def curry2[s,t,u](fun: (s, t)=>u)(a: s)(b: t) = fun(a, b) - implicit def curry3[r,s,t,u](fun: (r,s, t)=>u)(a: r)(b: s)(c: t) = fun(a, b, c) + implicit def curry3[r,s,t,u](fun: (r,s, t)=>u)(a: r)(b: s)(c: t) = fun(a, b, c) } object Test extends ParserIdioms with App { diff --git a/test/files/run/transform.scala b/test/files/run/transform.scala index 250df95df0..5cc1c49d6f 100644 --- a/test/files/run/transform.scala +++ b/test/files/run/transform.scala @@ -1,6 +1,6 @@ object Test { val x = 1 to 10 toBuffer - + def main(args: Array[String]): Unit = { x transform (_ * 2) assert(x.sum == (1 to 10).sum * 2) diff --git a/test/files/run/transpose.scala b/test/files/run/transpose.scala index 2761a24ff5..3bea74b365 100644 --- a/test/files/run/transpose.scala +++ b/test/files/run/transpose.scala @@ -1,8 +1,8 @@ object Test { - def wrap[T >: Null](body: => T) = + def wrap[T >: Null](body: => T) = try body catch { case _: IllegalArgumentException => null } - + def main(args: Array[String]): Unit = { assert(wrap(Nil.transpose) == Nil) assert(wrap(List(List(1, 2), List(1)).transpose) == null) diff --git a/test/files/run/treePrint.scala b/test/files/run/treePrint.scala index 452aaf390d..745c2150c2 100644 --- a/test/files/run/treePrint.scala +++ b/test/files/run/treePrint.scala @@ -4,7 +4,7 @@ object Test { import scala.tools.nsc._ import interpreter._ import java.io.{ OutputStream, BufferedReader, StringReader, PrintWriter, Writer, OutputStreamWriter} - + val code = """ def foo = { var q: Boolean = false @@ -22,11 +22,11 @@ object Test { else 20 } else 30 - + (x == 5) || !q || true } - """ - + """ + class NullOutputStream extends OutputStream { def write(b: Int) { } } def main(args: Array[String]) { diff --git a/test/files/run/triple-quoted-expr.scala b/test/files/run/triple-quoted-expr.scala index 6d91ac5888..0b30946de2 100644 --- a/test/files/run/triple-quoted-expr.scala +++ b/test/files/run/triple-quoted-expr.scala @@ -1,18 +1,18 @@ class A { def f1 = { val x = 5 - + """ hi""" } def f2 = { val x = 5 - + """hi""" - } + } def f3 = { val x = 5 - + "\nhi" } } diff --git a/test/files/run/try-2.scala b/test/files/run/try-2.scala index 909a68bbd2..677f0b48eb 100644 --- a/test/files/run/try-2.scala +++ b/test/files/run/try-2.scala @@ -7,7 +7,7 @@ object Test { - def tryAllUnit: Unit = + def tryAllUnit: Unit = try { throw new Error(); } @@ -15,28 +15,28 @@ object Test { case _ => Console.println("exception happened\n"); } - def tryUnitAll: Unit = + def tryUnitAll: Unit = try { Console.println("Nothin"); } catch { case _ => error("Bad, bad, lama!"); } - def tryAllAll: Unit = + def tryAllAll: Unit = try { throw new Error(); } catch { case _ => error("Bad, bad, lama!"); } - def tryUnitUnit: Unit = + def tryUnitUnit: Unit = try { Console.println("Nothin"); } catch { case _ => Console.println("Nothin"); } - def tryIntUnit: Unit = + def tryIntUnit: Unit = try { 10; } catch { @@ -55,7 +55,7 @@ object Test { execute(tryAllUnit); execute(tryUnitAll); execute(tryAllAll); - execute(tryUnitUnit); + execute(tryUnitUnit); execute(tryIntUnit); } } diff --git a/test/files/run/try.scala b/test/files/run/try.scala index 5545bcbec1..ad3d606246 100644 --- a/test/files/run/try.scala +++ b/test/files/run/try.scala @@ -17,8 +17,8 @@ object Test extends AnyRef with App { Console.println( (try { x } catch { case _: Error => 1; - }) - + + }) + + (try { x } catch { case _: Error => 1; }) @@ -116,7 +116,7 @@ object Test extends AnyRef with App { } */ - + try1; try2; try3; diff --git a/test/files/run/tuple-match.scala b/test/files/run/tuple-match.scala index fcaefbff5b..57ba9cf6e1 100644 --- a/test/files/run/tuple-match.scala +++ b/test/files/run/tuple-match.scala @@ -1,7 +1,7 @@ object Test { val FOUR = (-1, -2, -3, "bingo donkey vegas") val THREE = (-1, -2, -3) - + def f(x: Any) = x match { case FOUR => "FOUR" case (_, _, 3, _) => "4, #3" @@ -13,7 +13,7 @@ object Test { case (_, 2) => "2, #2" case _ => "default" } - + def main(args: Array[String]): Unit = { println(f((1, 2, 3, 4))) println(f((1, 2, 30, 4))) diff --git a/test/files/run/tuple-zipped.scala b/test/files/run/tuple-zipped.scala index 8f482dc3bf..a9851346bc 100644 --- a/test/files/run/tuple-zipped.scala +++ b/test/files/run/tuple-zipped.scala @@ -8,32 +8,32 @@ object Test { val as1 = 1 to 100 toArray val as2 = as1.view val as3 = as1 take 10 - + def xss1 = List[Seq[Int]](xs1, xs2, xs3, ss1, ss2, ss3, as1, as2, as3) def xss2 = List[Seq[Int]](xs1, xs2, xs3, ss3, as1, as2, as3) // no infinities def xss3 = List[Seq[Int]](xs2, xs3, ss3, as1) // representative sampling - + def main(args: Array[String]): Unit = { for (cc1 <- xss1 ; cc2 <- xss2) { val sum1 = (cc1, cc2).zip map { case (x, y) => x + y } sum val sum2 = (cc1, cc2).zipped map (_ + _) sum - + assert(sum1 == sum2) } - + for (cc1 <- xss1 ; cc2 <- xss2 ; cc3 <- xss3) { val sum1 = (cc1, cc2, cc3).zip map { case (x, y, z) => x + y + z } sum val sum2 = (cc1, cc2, cc3).zipped map (_ + _ + _) sum - + assert(sum1 == sum2) } - + assert((ss1, ss1).zipped exists ((x, y) => true)) assert((ss1, ss1, ss1).zipped exists ((x, y, z) => true)) - + assert(!(ss1, ss2, 1 to 3).zipped.exists(_ + _ + _ > 100000)) assert((1 to 3, ss1, ss2).zipped.forall(_ + _ + _ > 0)) assert((ss1, 1 to 3, ss2).zipped.map(_ + _ + _).size == 3) } } - + diff --git a/test/files/run/typealias_overriding.scala b/test/files/run/typealias_overriding.scala index 4b6a0037ec..8a2d1312ab 100644 --- a/test/files/run/typealias_overriding.scala +++ b/test/files/run/typealias_overriding.scala @@ -1,21 +1,21 @@ // this bug (http://scala-webapps.epfl.ch/bugtracking/bugs/displayItem.do?id=1065) -// was caused by Uncurry not normalizing all the types +// was caused by Uncurry not normalizing all the types // (more specifically the argument/return types of an anonymous Function) object Test extends App { trait AddRemove { type TNode <: NodeImpl; trait NodeImpl; - + object removing { type TNode = AddRemove.this.TNode; def printNode(node: TNode, f: TNode => String) = Console.println(f(node)) } } - + class Linked extends AddRemove { type TNode = Node // can also directly write `class Node extends super.NodeImpl' -- doesn't change the bug class Node extends super.NodeImpl { override def toString = "LinkedNode" } - + removing.printNode(new Node, (x: removing.TNode) => x.toString) // make inference explicit, doesn't affect the bug } diff --git a/test/files/run/unapply.scala b/test/files/run/unapply.scala index 0c5a70e768..90dd4fae73 100644 --- a/test/files/run/unapply.scala +++ b/test/files/run/unapply.scala @@ -22,7 +22,7 @@ object Faa { def unapply(x: Any): Option[String] = if(x.isInstanceOf[Bar]) Some(x.asInstanceOf[Bar].name) else None } object FaaPrecise { - def unapply(x: Bar): Option[String] = Some(x.name) + def unapply(x: Bar): Option[String] = Some(x.name) } object FaaPreciseSome { def unapply(x: Bar) = Some(x.name) // return type Some[String] @@ -108,14 +108,14 @@ object Test1256 { class Sync { def unapply(scrut: Any): Boolean = false } - + class Buffer { val Get = new Sync val jp: PartialFunction[Any, Any] = { case Get() => } } - + def run() { assert(!(new Buffer).jp.isDefinedAt(42)) } diff --git a/test/files/run/unittest_collection.scala b/test/files/run/unittest_collection.scala index 822e2b0c98..3639b496b3 100644 --- a/test/files/run/unittest_collection.scala +++ b/test/files/run/unittest_collection.scala @@ -12,7 +12,7 @@ object Test { } def test(x: Buffer[String]) { - // testing method += + // testing method += x += "one" assert(x(0) == "one", "retrieving 'one'") assert(x.length == 1, "length A") @@ -25,10 +25,10 @@ object Test { assert(x.length == 1, "length C") - try { x(1); sys.error("no exception for removed element") } + try { x(1); sys.error("no exception for removed element") } catch { case i:IndexOutOfBoundsException => } - try { x.remove(1); sys.error("no exception for removed element") } + try { x.remove(1); sys.error("no exception for removed element") } catch { case i:IndexOutOfBoundsException => } x += "two2" diff --git a/test/files/run/unittest_iterator.scala b/test/files/run/unittest_iterator.scala index 21dc64c3c5..89ccdb9d58 100644 --- a/test/files/run/unittest_iterator.scala +++ b/test/files/run/unittest_iterator.scala @@ -1,5 +1,5 @@ // Some iterator grouped/sliding unit tests -object Test { +object Test { def it = (1 to 10).iterator def assertThat[T](expectedLength: Int, expectedLast: Seq[T])(it: Iterator[Seq[T]]) { val xs = it.toList @@ -7,15 +7,15 @@ object Test { assert(xs.size == expectedLength, fail("expected length " + expectedLength)) assert(xs.last == expectedLast, fail("expected last " + expectedLast)) } - + def main(args: Array[String]): Unit = { val itSum = it.toStream.sum for (i <- it) { // sum of the groups == sum of the original val thisSum = ((it grouped i) map (_.sum)).toStream.sum - assert(thisSum == itSum, thisSum + " != " + itSum) + assert(thisSum == itSum, thisSum + " != " + itSum) } - + // grouped assertThat(4, List(10)) { it grouped 3 } assertThat(3, List(7, 8, 9)) { it grouped 3 withPartial false } @@ -32,11 +32,11 @@ object Test { assertThat(1, (1 to 8).toList) { it.sliding(8, 8) withPartial false } assertThat(2, List(9, 10, -1, -1, -1)) { it.sliding(5, 8) withPadding -1 } assertThat(1, (1 to 5).toList) { it.sliding(5, 8) withPartial false } - + // larger step than window assertThat(5, List(9)) { it.sliding(1, 2) } assertThat(3, List(9, 10)) { it.sliding(2, 4) } - + // make sure it throws past the end val thrown = try { val it = List(1,2,3).sliding(2) diff --git a/test/files/run/vector1.scala b/test/files/run/vector1.scala index e8785e2b16..b37cfe82e8 100644 --- a/test/files/run/vector1.scala +++ b/test/files/run/vector1.scala @@ -9,7 +9,7 @@ import scala.collection.mutable.Builder object Test { - + def vector(label: String, n: Int): Vector[String] = { val a = new VectorBuilder[String] for (i <- 0 until n) @@ -67,7 +67,7 @@ object Test { def test1() = { println("===== test1 =====") - + val N = 150000 val a = vector("a", N) val b = vectorForward("b", N) @@ -81,22 +81,22 @@ object Test { println("===== test2 =====") var a: Vector[String] = Vector.empty - + val rand = new java.util.Random - + val N = 150000 var min = N/2//rand.nextInt(N) var max = min - + val chunkLimit = 11 - + def nextChunkSize = 3 //rand.nextInt(chunkLimit) - + def seqBack() = for (i <- 0 until Math.min(nextChunkSize, N-max)) { a = a :+ ("a"+max); max += 1 } def seqFront() = for (i <- 0 until Math.min(nextChunkSize, min)) { min -= 1; a = ("a"+min) +: a } - + try { - + while (min > 0 || max < N) { seqFront() seqBack() @@ -107,7 +107,7 @@ object Test { //a.debug throw ex } - + assertVector(a, "a", 0, N) } @@ -122,14 +122,14 @@ object Test { val pos = scala.util.Random.shuffle(scala.collection.mutable.WrappedArray.make[Int](Array.tabulate[Int](N)(i => i))) var b = a - + { var i = 0 while (i < N) { b = b.updated(pos(i), "b"+(pos(i))) i += 1 } - + assertVector(b, "b", 0, N) } diff --git a/test/files/run/view-headoption.scala b/test/files/run/view-headoption.scala index 659c7e6b82..629b974c19 100644 --- a/test/files/run/view-headoption.scala +++ b/test/files/run/view-headoption.scala @@ -2,13 +2,13 @@ object Test { val failer = () => { println("fail") ; None } val succeeder = () => { println("success") ; Some(5) } val fs = List(failer, succeeder, failer, failer, succeeder, failer, failer, failer, succeeder) - + def f0 = fs.view flatMap (f => f()) def f1 = f0.headOption def f2 = f0.head def f3 = f0.lastOption def f4 = f0.last - + def main(args: Array[String]): Unit = { println("f1: " + f1) println("f2: " + f2) diff --git a/test/files/run/view-iterator-stream.scala b/test/files/run/view-iterator-stream.scala index 5ac299a34d..f91407f92c 100644 --- a/test/files/run/view-iterator-stream.scala +++ b/test/files/run/view-iterator-stream.scala @@ -18,7 +18,7 @@ object Test { } def and(g: Perturber): Perturber = new Perturber(this.labels ++ g.labels, f andThen g.f) - + override def toString = labels mkString " -> " } object Perturber { @@ -39,14 +39,14 @@ object Test { "slice(%d, %d)".format(from, until), _.toTraversable.slice(from, until) ) - + val fns = List[Perturber](toV, toI, toS, toIS) def tds(n: Int): Perturber = p(drop(n), take(n / 2), slice(1, n / 4)) def dts(n: Int): Perturber = p(take(n), drop(n / 2), slice(1, n / 4)) def sdt(n: Int): Perturber = p(slice(n, n * 2), drop(n / 2), take(n / 4)) def std(n: Int): Perturber = p(slice(n, n * 2), take(n / 2), drop(n / 4)) - + val transforms = (fns.permutations map (xs => p(xs take 3: _*))).toList.distinct def mkOps(n: Int) = List[Perturber](tds(n), dts(n), sdt(n), std(n)) def runOps(n: Int) = { @@ -60,7 +60,7 @@ object Test { } () } - + def main(args: Array[String]): Unit = { runOps(20) } diff --git a/test/files/run/viewtest.scala b/test/files/run/viewtest.scala index 581958e9a6..bb2c28d68a 100755 --- a/test/files/run/viewtest.scala +++ b/test/files/run/viewtest.scala @@ -25,8 +25,8 @@ object Test extends App { 2.8 regression: CCE when zipping list projection with stream Reported by: szeiger Owned by: odersky Priority: normal Component: Standard Library -Keywords: collections, zip Cc: -Fixed in version: +Keywords: collections, zip Cc: +Fixed in version: Description Welcome to Scala version 2.8.0.r18784-b20090925021043 (Java HotSpot(TM) Client VM, Java 1.6.0_11). diff --git a/test/files/run/virtpatmat_apply.scala b/test/files/run/virtpatmat_apply.scala index b8776f4afb..34cb80e449 100644 --- a/test/files/run/virtpatmat_apply.scala +++ b/test/files/run/virtpatmat_apply.scala @@ -1,5 +1,5 @@ object Test extends App { - List(1, 2, 3) match { + List(1, 2, 3) match { case Nil => println("FAIL") case x :: y :: xs if xs.length == 2 => println("FAIL") case x :: y :: xs if xs.length == 1 => println("OK "+ y) diff --git a/test/files/run/virtpatmat_casting.scala b/test/files/run/virtpatmat_casting.scala index 7c5e1c7117..d970abae90 100644 --- a/test/files/run/virtpatmat_casting.scala +++ b/test/files/run/virtpatmat_casting.scala @@ -1,7 +1,7 @@ object Test extends App { - println(List(1,2,3) match { - case Nil => List(0) -// since the :: extractor's argument must be a ::, there has to be a cast before its unapply is invoked + println(List(1,2,3) match { + case Nil => List(0) +// since the :: extractor's argument must be a ::, there has to be a cast before its unapply is invoked case x :: y :: z :: a :: xs => xs ++ List(x) case x :: y :: z :: xs => xs ++ List(x) }) diff --git a/test/files/run/virtpatmat_literal.scala b/test/files/run/virtpatmat_literal.scala index 460811eba9..cb72b1d2a5 100644 --- a/test/files/run/virtpatmat_literal.scala +++ b/test/files/run/virtpatmat_literal.scala @@ -1,21 +1,21 @@ object Test extends App { - 1 match { - case 2 => println("FAILED") - case 1 => println("OK") - case 1 => println("FAILED") + 1 match { + case 2 => println("FAILED") + case 1 => println("OK") + case 1 => println("FAILED") } val one = 1 - 1 match { - case 2 => println("FAILED") - case `one` => println("OK") - case 1 => println("FAILED") + 1 match { + case 2 => println("FAILED") + case `one` => println("OK") + case 1 => println("FAILED") } - 1 match { - case 2 => println("FAILED") - case Test.one => println("OK") - case 1 => println("FAILED") + 1 match { + case 2 => println("FAILED") + case Test.one => println("OK") + case 1 => println("FAILED") } } \ No newline at end of file diff --git a/test/files/run/virtpatmat_partial.scala b/test/files/run/virtpatmat_partial.scala index d30944efb4..c408b31983 100644 --- a/test/files/run/virtpatmat_partial.scala +++ b/test/files/run/virtpatmat_partial.scala @@ -36,7 +36,7 @@ object Test extends App { // else // o9 // }) - // + // // def isDefinedAt(x_1: (String, Option[Int])): Boolean = MatchingStrategy.OptionMatchingStrategy.isSuccess[(String, Option[Int]), (String, Int)](x_1)( // (x1: (String, Option[Int])) => { // val o9: Option[(String, Int)] = ({ diff --git a/test/files/run/virtpatmat_typed.scala b/test/files/run/virtpatmat_typed.scala index cdd6d3c749..a9863cc48a 100644 --- a/test/files/run/virtpatmat_typed.scala +++ b/test/files/run/virtpatmat_typed.scala @@ -1,7 +1,7 @@ object Test extends App { - ("foo": Any) match { - case x: Int => println("FAILED") - case x: String => println("OK "+ x) - case x: String => println("FAILED") + ("foo": Any) match { + case x: Int => println("FAILED") + case x: String => println("OK "+ x) + case x: String => println("FAILED") } } \ No newline at end of file diff --git a/test/files/run/virtpatmat_unapply.scala b/test/files/run/virtpatmat_unapply.scala index a6e71f3963..6d7b4dbe68 100644 --- a/test/files/run/virtpatmat_unapply.scala +++ b/test/files/run/virtpatmat_unapply.scala @@ -6,12 +6,12 @@ object IntList { } object Test extends App { - IntList(1, IntList(2, NilIL)) match { + IntList(1, IntList(2, NilIL)) match { case IntList(a1, IntList(a2, IntList(a3, y))) => println(a1 + a2 + a3) case IntList(x, y) => println(x) } - IntList(1, IntList(2, IntList(3, NilIL))) match { + IntList(1, IntList(2, IntList(3, NilIL))) match { case IntList(a1, IntList(a2, IntList(a3, y))) => println(a1 + a2 + a3) case IntList(x, y) => println(x) } @@ -20,12 +20,12 @@ object Test extends App { // ((x1: IntList) => IntList.unapply(x1).flatMap(((x4: (Int, IntList)) => IntList.unapply(x4._2).flatMap(((x5: (Int, IntList)) => IntList.unapply(x5._2).flatMap(((x6: (Int, IntList)) => implicitly[Predef.MatchingStrategy[Option]].success(Predef.println(x4._1.+(x5._1).+(x6._1))))))))).orElse(IntList.unapply(x1).flatMap(((x7: (Int, IntList)) => implicitly[scala.Predef.MatchingStrategy[Option]].success(Predef.println(x7._1))))).orElse(implicitly[scala.Predef.MatchingStrategy[Option]].fail))(IntList.apply(1, IntList.apply(2, IntList.apply(3, null)))) /* - ((x1: IntList) => - IntList.this.unapply(x1).flatMap[Int](((x4: (Int, IntList)) => - IntList.this.unapply(x4._2).flatMap[Int](((x5: (Int, IntList)) => - IntList.this.unapply(x5._2).flatMap[Int](((x6: (Int, IntList)) => + ((x1: IntList) => + IntList.this.unapply(x1).flatMap[Int](((x4: (Int, IntList)) => + IntList.this.unapply(x4._2).flatMap[Int](((x5: (Int, IntList)) => + IntList.this.unapply(x5._2).flatMap[Int](((x6: (Int, IntList)) => Predef.this.implicitly[scala.Predef.MatchingStrategy[Option]](scala.this.Predef.OptionMatching).success[Int](x6._1))))))).orElse[Int]( - IntList.this.unapply(x1).flatMap[Int](((x7: (Int, IntList)) => + IntList.this.unapply(x1).flatMap[Int](((x7: (Int, IntList)) => Predef.this.implicitly[scala.Predef.MatchingStrategy[Option]](scala.this.Predef.OptionMatching).success[Int](x7._1)))).orElse[Int]( Predef.this.implicitly[scala.Predef.MatchingStrategy[Option]](scala.this.Predef.OptionMatching).fail) ).apply(IntList.apply(1, null)) diff --git a/test/files/run/xml-loop-bug.scala b/test/files/run/xml-loop-bug.scala index 3894779f7c..378ae9bc2b 100644 --- a/test/files/run/xml-loop-bug.scala +++ b/test/files/run/xml-loop-bug.scala @@ -1,6 +1,6 @@ object Test { def main(args: Array[String]): Unit = { scala.tools.nsc.io.NullPrintStream.setOutAndErr() - scala.xml.parsing.ConstructingParser.fromSource(scala.io.Source.fromString(" "), true).document.docElem + scala.xml.parsing.ConstructingParser.fromSource(scala.io.Source.fromString(" "), true).document.docElem } } -- cgit v1.2.3