diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-07-17 09:27:29 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-08-27 10:26:21 -0700 |
commit | 9c50dd52743b7ff4de19548669dfa7e7a0304034 (patch) | |
tree | 8b0044529b3106ea84bca046dc5710fada708cce /test/files/run/fors.scala | |
parent | 7817efe2468480317965fc5baece52be392f0f7a (diff) | |
download | scala-9c50dd52743b7ff4de19548669dfa7e7a0304034.tar.gz scala-9c50dd52743b7ff4de19548669dfa7e7a0304034.tar.bz2 scala-9c50dd52743b7ff4de19548669dfa7e7a0304034.zip |
Prepare removal of scala-xml, scala-parser-combinators
Every test deleted here has found its way to the respective
repositories of scala-xml and scala-parser-combinators,
where they will continue to be tested with partest.
The modified tests became independent of these modules,
as they should've been from the start.
Diffstat (limited to 'test/files/run/fors.scala')
-rw-r--r-- | test/files/run/fors.scala | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/test/files/run/fors.scala b/test/files/run/fors.scala deleted file mode 100644 index 54afdc710b..0000000000 --- a/test/files/run/fors.scala +++ /dev/null @@ -1,97 +0,0 @@ -//############################################################################ -// for-comprehensions (old and new syntax) -//############################################################################ - -//############################################################################ - -object Test extends App { - val xs = List(1, 2, 3) - val ys = List('a, 'b, 'c) - - def it = 0 until 10 - - val ar = "abc".toCharArray - - val xml = - <html> - <head><title>Scala</title></head> - <body>{xs}</body> - </html>; - - /////////////////// old syntax /////////////////// - - def testOld { - println("\ntestOld") - - // lists - 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 (_ <- 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 (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 (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 (x <- xml.child) println(x) - for (x <- xml.child; - if x.label == "head") println(x) - } - - /////////////////// new syntax /////////////////// - - def testNew { - println("\ntestNew") - - // lists - var n = 0 - 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 (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 - for (x <- it; - if x % 2 == 0) print(x + " "); println - for (x <- it - if x % 2 == 0) print(x + " "); println - for {x <- it - if x % 2 == 0} print(x + " "); println - for (x <- it; - y = 2 - if x % y == 0) print(x + " "); println - for {x <- it - y = 2 - if x % y == 0} print(x + " "); println - - // arrays - for (x <- ar) print(x + " "); println - - // sequences - for (x <- xml.child) println(x) - for (x <- xml.child if x.label == "head") println(x) - } - - //////////////////////////////////////////////////// - - testOld - testNew -} |