aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-04-09 17:39:12 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-04-09 17:39:12 +0200
commitf63589838344e91f84621162d9e0a4cc2c532949 (patch)
tree33431f7cbca4509b306d4c04e44c44591c2f9b0b /tests/untried/pos
parentd7c44086cc34eee7991753fc2ea284bdefed9670 (diff)
downloaddotty-f63589838344e91f84621162d9e0a4cc2c532949.tar.gz
dotty-f63589838344e91f84621162d9e0a4cc2c532949.tar.bz2
dotty-f63589838344e91f84621162d9e0a4cc2c532949.zip
Add spaces around + in tests.
Diffstat (limited to 'tests/untried/pos')
-rw-r--r--tests/untried/pos/FPTest.scala2
-rw-r--r--tests/untried/pos/iterator-traversable-mix.scala2
-rw-r--r--tests/untried/pos/nested.scala6
-rw-r--r--tests/untried/pos/sudoku.scala12
-rw-r--r--tests/untried/pos/t3136.scala4
-rw-r--r--tests/untried/pos/t592.scala4
-rw-r--r--tests/untried/pos/t789.scala12
-rw-r--r--tests/untried/pos/unapplyVal.scala2
8 files changed, 22 insertions, 22 deletions
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)
}
}
}