From f63589838344e91f84621162d9e0a4cc2c532949 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Thu, 9 Apr 2015 17:39:12 +0200 Subject: Add spaces around + in tests. --- tests/untried/neg-with-implicits/implicits.scala | 2 +- tests/untried/neg/for-comprehension-old.scala | 16 ++++++++-------- tests/untried/neg/names-defaults-neg.scala | 2 +- tests/untried/neg/specification-scopes/P_2.scala | 16 ++++++++-------- tests/untried/neg/switch.scala | 2 +- tests/untried/neg/t5702-neg-bad-xbrace.scala | 2 +- tests/untried/neg/t5702-neg-ugly-xbrace.scala | 2 +- tests/untried/neg/t856.scala | 2 +- tests/untried/neg/warn-unused-privates.scala | 2 +- tests/untried/pos/FPTest.scala | 2 +- tests/untried/pos/iterator-traversable-mix.scala | 2 +- tests/untried/pos/nested.scala | 6 +++--- tests/untried/pos/sudoku.scala | 12 ++++++------ tests/untried/pos/t3136.scala | 4 ++-- tests/untried/pos/t592.scala | 4 ++-- tests/untried/pos/t789.scala | 12 ++++++------ tests/untried/pos/unapplyVal.scala | 2 +- 17 files changed, 45 insertions(+), 45 deletions(-) (limited to 'tests/untried') diff --git a/tests/untried/neg-with-implicits/implicits.scala b/tests/untried/neg-with-implicits/implicits.scala index 22633a1f3..5cb09804c 100644 --- a/tests/untried/neg-with-implicits/implicits.scala +++ b/tests/untried/neg-with-implicits/implicits.scala @@ -18,7 +18,7 @@ object Test { import Sub._ val p = new Pos def f(x: Int): Int = x - f(p+1) + f(p + 1) } object test2 { diff --git a/tests/untried/neg/for-comprehension-old.scala b/tests/untried/neg/for-comprehension-old.scala index 10ae363bd..270861751 100644 --- a/tests/untried/neg/for-comprehension-old.scala +++ b/tests/untried/neg/for-comprehension-old.scala @@ -1,11 +1,11 @@ class A { - for (x <- 1 to 5 ; y = x) yield x+y // ok - for (x <- 1 to 5 ; val y = x) yield x+y // fail - for (val x <- 1 to 5 ; y = x) yield x+y // fail - for (val x <- 1 to 5 ; val y = x) yield x+y // fail + for (x <- 1 to 5 ; y = x) yield x + y // ok + for (x <- 1 to 5 ; val y = x) yield x + y // fail + for (val x <- 1 to 5 ; y = x) yield x + y // fail + for (val x <- 1 to 5 ; val y = x) yield x + y // fail - for (z <- 1 to 2 ; x <- 1 to 5 ; y = x) yield x+y // ok - for (z <- 1 to 2 ; x <- 1 to 5 ; val y = x) yield x+y // fail - for (z <- 1 to 2 ; val x <- 1 to 5 ; y = x) yield x+y // fail - for (z <- 1 to 2 ; val x <- 1 to 5 ; val y = x) yield x+y // fail + for (z <- 1 to 2 ; x <- 1 to 5 ; y = x) yield x + y // ok + for (z <- 1 to 2 ; x <- 1 to 5 ; val y = x) yield x + y // fail + for (z <- 1 to 2 ; val x <- 1 to 5 ; y = x) yield x + y // fail + for (z <- 1 to 2 ; val x <- 1 to 5 ; val y = x) yield x + y // fail } diff --git a/tests/untried/neg/names-defaults-neg.scala b/tests/untried/neg/names-defaults-neg.scala index 2f8700ac6..589259622 100644 --- a/tests/untried/neg/names-defaults-neg.scala +++ b/tests/untried/neg/names-defaults-neg.scala @@ -98,7 +98,7 @@ object Test extends App { f3818(y = 1, m = 1) // DEFINITIONS - def test1(a: Int, b: String) = a +": "+ b + def test1(a: Int, b: String) = a +": " + b def test2(x: Unit) = println("test2") def test3(a: Int, b: Int) = a + b def test7(m: Int) = m diff --git a/tests/untried/neg/specification-scopes/P_2.scala b/tests/untried/neg/specification-scopes/P_2.scala index d59f82e90..03a52bdcd 100644 --- a/tests/untried/neg/specification-scopes/P_2.scala +++ b/tests/untried/neg/specification-scopes/P_2.scala @@ -1,21 +1,21 @@ package P { // 'X' bound by package clause import Console._ // 'println' bound by wildcard import object A { - println("L4: "+X) // 'X' refers to 'P.X' here + println("L4: " + X) // 'X' refers to 'P.X' here object B { import Q._ // 'X' bound by wildcard import - println("L7: "+X) // 'X' refers to 'Q.X' here + println("L7: " + X) // 'X' refers to 'Q.X' here import X._ // 'x' and 'y' bound by wildcard import - println("L8: "+x) // 'x' refers to 'Q.X.x' here + println("L8: " + x) // 'x' refers to 'Q.X.x' here object C { val x = 3 // 'x' bound by local definition - println("L12: "+x); // 'x' refers to constant '3' here + println("L12: " + x); // 'x' refers to constant '3' here { import Q.X._ // 'x' and 'y' bound by wildcard - println("L14: "+x) // reference to 'x' is ambiguous here + println("L14: " + x) // reference to 'x' is ambiguous here import X.y // 'y' bound by explicit import - println("L16: "+y); // 'y' refers to 'Q.X.y' here + println("L16: " + y); // 'y' refers to 'Q.X.y' here { val x = "abc" // 'x' bound by local definition import P.X._ // 'x' and 'y' bound by wildcard - println("L19: "+y) // reference to 'y' is ambiguous here - println("L20: "+x) // 'x' refers to string ''abc'' here + println("L19: " + y) // reference to 'y' is ambiguous here + println("L20: " + x) // 'x' refers to string ''abc'' here }}}}}} diff --git a/tests/untried/neg/switch.scala b/tests/untried/neg/switch.scala index a66ed768f..b4d3392f9 100644 --- a/tests/untried/neg/switch.scala +++ b/tests/untried/neg/switch.scala @@ -55,7 +55,7 @@ object Main { } // some ints just to mix it up a bit - def succ4(x: Int, y: Int) = ((x+y): @switch) match { + def succ4(x: Int, y: Int) = ((x + y): @switch) match { case 1 => 5 case 2 => 10 case 3 => 20 diff --git a/tests/untried/neg/t5702-neg-bad-xbrace.scala b/tests/untried/neg/t5702-neg-bad-xbrace.scala index 64bbdb18b..89f5b5d62 100644 --- a/tests/untried/neg/t5702-neg-bad-xbrace.scala +++ b/tests/untried/neg/t5702-neg-bad-xbrace.scala @@ -26,6 +26,6 @@ object Test { val xml = appleboychild // bad brace or paren after _* val {a, z@_*)} = xml - println("A for "+ a +", ending with "+ z) + println("A for " + a +", ending with "+ z) } } diff --git a/tests/untried/neg/t5702-neg-ugly-xbrace.scala b/tests/untried/neg/t5702-neg-ugly-xbrace.scala index 0ff7bfa09..bb587e812 100644 --- a/tests/untried/neg/t5702-neg-ugly-xbrace.scala +++ b/tests/untried/neg/t5702-neg-ugly-xbrace.scala @@ -9,6 +9,6 @@ object Test { // Assuming } for ) after _* would not be not outlandish. // bad brace or paren after _* val {a, z@_*) = xml - println("A for "+ a +", ending with "+ z) + println("A for " + a +", ending with "+ z) } } diff --git a/tests/untried/neg/t856.scala b/tests/untried/neg/t856.scala index fea216bfa..a239ac9eb 100644 --- a/tests/untried/neg/t856.scala +++ b/tests/untried/neg/t856.scala @@ -1,7 +1,7 @@ trait Complex extends Product2[Double,Double] class ComplexRect(val _1:Double, _2:Double) extends Complex { - override def toString = "ComplexRect("+_1+","+_2+")" + override def toString = "ComplexRect(" +_1 +","+_2 +")" } object Test { diff --git a/tests/untried/neg/warn-unused-privates.scala b/tests/untried/neg/warn-unused-privates.scala index cb6e946a3..64e7679f3 100644 --- a/tests/untried/neg/warn-unused-privates.scala +++ b/tests/untried/neg/warn-unused-privates.scala @@ -1,7 +1,7 @@ class Bippy(a: Int, b: Int) { private def this(c: Int) = this(c, c) // warn private def bippy(x: Int): Int = bippy(x) // TODO: could warn - private def boop(x: Int) = x+a+b // warn + private def boop(x: Int) = x + a + b // warn final private val MILLIS1 = 2000 // no warn, might have been inlined final private val MILLIS2: Int = 1000 // warn final private val HI_COMPANION: Int = 500 // no warn, accessed from companion diff --git a/tests/untried/pos/FPTest.scala b/tests/untried/pos/FPTest.scala index b351b7bb9..6fab0fe67 100644 --- a/tests/untried/pos/FPTest.scala +++ b/tests/untried/pos/FPTest.scala @@ -4,7 +4,7 @@ import annotation.strictfp @strictfp class FPTest { def main(args: Array[String]): Unit = { - val d: Double = 8e+307 + val d: Double = 8e + 307 println(4.0 * d * 0.5); println(2.0 * d); } diff --git a/tests/untried/pos/iterator-traversable-mix.scala b/tests/untried/pos/iterator-traversable-mix.scala index 2d6bf44c7..acc9c13ad 100644 --- a/tests/untried/pos/iterator-traversable-mix.scala +++ b/tests/untried/pos/iterator-traversable-mix.scala @@ -4,5 +4,5 @@ object Test { x2 <- Iterator(3, 4) x3 <- Seq(5, 6).iterator x4 <- Stream(7, 8) - } yield x1+x2+x3+x4 + } yield x1 + x2 + x3 + x4 } diff --git a/tests/untried/pos/nested.scala b/tests/untried/pos/nested.scala index b038fce39..f73790ae0 100644 --- a/tests/untried/pos/nested.scala +++ b/tests/untried/pos/nested.scala @@ -4,9 +4,9 @@ class A(pa : Int) { def a1 = pa; class B(pb : Int) { - def b1 = pa+pb+a1; + def b1 = pa + pb + a1; class C(pc : Int) extends A(b1) { - def c1 = pc+pb+pa + def c1 = pc + pb + pa } val c1 = new C(66) } @@ -22,7 +22,7 @@ class A1(x0 : Int) extends A(x0) with M { class D() extends B(42) { val c2 = new C(66); class E() extends C(5) { - def e1 = c1+b1+a1; + def e1 = c1 + b1 + a1; def e2 = new D(); } } diff --git a/tests/untried/pos/sudoku.scala b/tests/untried/pos/sudoku.scala index 9435f504d..44c59b978 100644 --- a/tests/untried/pos/sudoku.scala +++ b/tests/untried/pos/sudoku.scala @@ -12,12 +12,12 @@ object SudokuSolver extends App { // coordinate def invalid(i: Int, x: Int, y: Int, n: Char): Boolean = i<9 && (m(y)(i) == n || m(i)(x) == n || - m(y/3*3 + i/3)(x/3*3 + i % 3) == n || invalid(i+1, x, y, n)) + m(y/3*3 + i/3)(x/3*3 + i % 3) == n || invalid(i + 1, x, y, n)) // Looping over a half-closed range of consecutive integers [l..u) // is factored out into a higher-order function def fold(f: (Int, Int) => Int, accu: Int, l: Int, u: Int): Int = - if(l==u) accu else fold(f, f(accu, l), l+1, u) + if(l==u) accu else fold(f, f(accu, l), l + 1, u) // The search function examines each position on the board in turn, // trying the numbers 1..9 in each unfilled position @@ -25,17 +25,17 @@ object SudokuSolver extends App { // accu by applying the given function f to it whenever a solution m // is found def search(x:Int, y:Int, f: (Int) => Int, accu: Int): Int = (x, y) match { - case (9, y) => search(0, y+1, f, accu) // next row + case (9, y) => search(0, y + 1, f, accu) // next row case (0, 9) => f(accu) // found a solution - case (x, y) => if (m(y)(x) != '0') search(x+1, y, f, accu) else + case (x, y) => if (m(y)(x) != '0') search(x + 1, y, f, accu) else fold((accu: Int, n: Int) => if (invalid(0, x, y, (n + 48).toChar)) accu else { m(y)(x) = (n + 48).toChar; - val newaccu = search(x+1, y, f, accu); + val newaccu = search(x + 1, y, f, accu); m(y)(x) = '0'; newaccu}, accu, 1, 10)} // The main part of the program uses the search function to accumulate // the total number of solutions - println("\n"+search(0,0,i => {print; i+1},0)+" solution(s)") + println("\n" + search(0,0,i => {print; i + 1},0)+" solution(s)") } diff --git a/tests/untried/pos/t3136.scala b/tests/untried/pos/t3136.scala index 33d42c2f3..239bd8f54 100644 --- a/tests/untried/pos/t3136.scala +++ b/tests/untried/pos/t3136.scala @@ -13,7 +13,7 @@ object NullaryMethodType { object Test { def TEST(tp: Type): String = tp match { - case PolyType(ps1, PolyType(ps2, res @ PolyType(a, b))) => "1"+tp // couldn't find a simpler version that still crashes - case NullaryMethodType(meh) => "2"+meh + case PolyType(ps1, PolyType(ps2, res @ PolyType(a, b))) => "1" + tp // couldn't find a simpler version that still crashes + case NullaryMethodType(meh) => "2" + meh } } diff --git a/tests/untried/pos/t592.scala b/tests/untried/pos/t592.scala index 6a941ef51..bad1c8528 100644 --- a/tests/untried/pos/t592.scala +++ b/tests/untried/pos/t592.scala @@ -19,7 +19,7 @@ abstract class DirectedGraph extends Graph { class EdgeImpl(origin: Node, dest: Node) { def from = origin; def to = dest; - override def toString = ""+origin+" --> "+dest + override def toString = "" + origin +" --> "+ dest } class NodeImpl extends NodeIntf { self: Node => @@ -30,7 +30,7 @@ abstract class DirectedGraph extends Graph { edges = edge :: edges; edge; } - override def toString = "Node "+id + override def toString = "Node " + id } protected def newNode: Node; diff --git a/tests/untried/pos/t789.scala b/tests/untried/pos/t789.scala index 7a17f10b0..c453e229a 100644 --- a/tests/untried/pos/t789.scala +++ b/tests/untried/pos/t789.scala @@ -9,16 +9,16 @@ object main { // don't do this at home type Both = SizeImpl with ColorImpl def info(x:Impl) = x match { - case x:Both => "size "+x.size+" color "+x.color // you wish - case x:SizeImpl => "size "+x.size - case x:ColorImpl => "color "+x.color + case x:Both => "size " + x.size +" color "+ x.color // you wish + case x:SizeImpl => "size " + x.size + case x:ColorImpl => "color " + x.color case _ => "n.a." } def info2(x:Impl) = x match { - case x:SizeImpl with ColorImpl => "size "+x.size+" color "+x.color // you wish - case x:SizeImpl => "size "+x.size - case x:ColorImpl => "color "+x.color + case x:SizeImpl with ColorImpl => "size " + x.size +" color "+ x.color // you wish + case x:SizeImpl => "size " + x.size + case x:ColorImpl => "color " + x.color case _ => "n.a." } diff --git a/tests/untried/pos/unapplyVal.scala b/tests/untried/pos/unapplyVal.scala index 368b9b937..d6dea324f 100644 --- a/tests/untried/pos/unapplyVal.scala +++ b/tests/untried/pos/unapplyVal.scala @@ -12,7 +12,7 @@ class Buffer { x match { case Put => case Put(y) => - println("returning "+y) + println("returning " + y) } } } -- cgit v1.2.3