summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-02 17:40:25 +0000
committerPaul Phillips <paulp@improving.org>2011-01-02 17:40:25 +0000
commit635bc9c17b0d35e9cf8029cf24aee8d3594a143f (patch)
tree7b7ca9282bd2c009f9c0e1c4c00ffb7eedf94802 /test
parent533ffe9482c530489ad4f6670831b8d87f78193a (diff)
downloadscala-635bc9c17b0d35e9cf8029cf24aee8d3594a143f.tar.gz
scala-635bc9c17b0d35e9cf8029cf24aee8d3594a143f.tar.bz2
scala-635bc9c17b0d35e9cf8029cf24aee8d3594a143f.zip
Misc uninteresting tidbits to take some weight ...
Misc uninteresting tidbits to take some weight off overly large patches in progress. No review.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/Course-2002-05.scala6
-rw-r--r--test/files/run/bug978.scala6
-rw-r--r--test/files/run/enums.scala4
-rw-r--r--test/files/run/fors.scala42
4 files changed, 29 insertions, 29 deletions
diff --git a/test/files/run/Course-2002-05.scala b/test/files/run/Course-2002-05.scala
index a1d71e2818..e6764b92c8 100644
--- a/test/files/run/Course-2002-05.scala
+++ b/test/files/run/Course-2002-05.scala
@@ -178,9 +178,9 @@ object M4 {
isSafe(col, p.tail, delta + 1)));
for (
- val placement <- placeQueens(row - 1);
- val col <- columns;
- isSafe(col, placement, 1)
+ placement <- placeQueens(row - 1);
+ col <- columns;
+ if isSafe(col, placement, 1)
) yield {
col :: placement
}
diff --git a/test/files/run/bug978.scala b/test/files/run/bug978.scala
index 72dfdbae0a..a2df87b0ed 100644
--- a/test/files/run/bug978.scala
+++ b/test/files/run/bug978.scala
@@ -13,14 +13,14 @@ object Test extends Application {
// val set = new collection.jcl.HashSet[Foo]
val max = 200
- for (val x <- 1 to max)
+ for (x <- 1 to max)
set += new Foo(x)
testRemove(2)
testExists(2)
def testRemove(m: Int) {
- for (val x <- 1 to max; x % m == 0) {
+ for (x <- 1 to max; if x % m == 0) {
val f = new Foo(x)
set -= f
assert(!(set contains f))
@@ -29,7 +29,7 @@ object Test extends Application {
}
def testExists(m: Int) {
- for (val x <- 1 to max; x % m == 1) {
+ for (x <- 1 to max; if x % m == 1) {
val f = new Foo(x)
assert(set contains f, "For element: " + f + " set: " + set)
}
diff --git a/test/files/run/enums.scala b/test/files/run/enums.scala
index fcca8d3438..6dda8cbc6e 100644
--- a/test/files/run/enums.scala
+++ b/test/files/run/enums.scala
@@ -29,7 +29,7 @@ object Test2 {
}
def run: Int = {
- val it = for (val s <- ThreadState.values; s.id != 0) yield s;
+ val it = for (s <- ThreadState.values; if s.id != 0) yield s;
it.toList.length
}
}
@@ -41,7 +41,7 @@ object Test3 {
}
def run: Int = {
- val it = for (val d <- Direction.values; d.toString() startsWith "N") yield d;
+ val it = for (d <- Direction.values; if d.toString() startsWith "N") yield d;
it.toList.length
}
}
diff --git a/test/files/run/fors.scala b/test/files/run/fors.scala
index 868a05369b..2cd4cf135c 100644
--- a/test/files/run/fors.scala
+++ b/test/files/run/fors.scala
@@ -24,34 +24,34 @@ object Test extends Application {
println("\ntestOld")
// lists
- for (val x <- xs) print(x + " "); println
- for (val x <- xs;
- x % 2 == 0) print(x + " "); println
- for {val x <- xs
- x % 2 == 0} print(x + " "); println
+ for (x <- xs) print(x + " "); println
+ for (x <- xs;
+ if x % 2 == 0) print(x + " "); println
+ for {x <- xs
+ if x % 2 == 0} print(x + " "); println
var n = 0
- for (val _ <- xs) n += 1; println(n)
- for (val (x, y) <- xs zip ys) print(x + " "); println
- for (val p @ (x, y) <- xs zip ys) print(p._1 + " "); println
+ for (_ <- xs) n += 1; println(n)
+ for ((x, y) <- xs zip ys) print(x + " "); println
+ for (p @ (x, y) <- xs zip ys) print(p._1 + " "); println
// iterators
- for (val x <- it) print(x + " "); println
- for (val x <- it;
- x % 2 == 0) print(x + " "); println
- for {val x <- it
- x % 2 == 0} print(x + " "); println
+ for (x <- it) print(x + " "); println
+ for (x <- it;
+ if x % 2 == 0) print(x + " "); println
+ for {x <- it
+ if x % 2 == 0} print(x + " "); println
// arrays
- for (val x <- ar) print(x + " "); println
- for (val x <- ar;
- x.toInt > 97) print(x + " "); println
- for {val x <- ar
- x.toInt > 97} print(x + " "); println
+ for (x <- ar) print(x + " "); println
+ for (x <- ar;
+ if x.toInt > 97) print(x + " "); println
+ for {x <- ar
+ if x.toInt > 97} print(x + " "); println
// sequences
- for (val x <- xml.child) println(x)
- for (val x <- xml.child;
- x.label == "head") println(x)
+ for (x <- xml.child) println(x)
+ for (x <- xml.child;
+ if x.label == "head") println(x)
}
/////////////////// new syntax ///////////////////