diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/fors.check | 18 | ||||
-rw-r--r-- | test/files/run/fors.scala | 15 |
2 files changed, 33 insertions, 0 deletions
diff --git a/test/files/run/fors.check b/test/files/run/fors.check index b459f00b49..08ecc8ed5f 100644 --- a/test/files/run/fors.check +++ b/test/files/run/fors.check @@ -13,6 +13,15 @@ a b c b c b c + +<head><title>Scala</title></head> + + +<body>1 2 3</body> + + +<head><title>Scala</title></head> + testNew 3 1 2 3 @@ -26,3 +35,12 @@ testNew 0 2 4 6 8 0 2 4 6 8 a b c + + +<head><title>Scala</title></head> + + +<body>1 2 3</body> + + +<head><title>Scala</title></head> diff --git a/test/files/run/fors.scala b/test/files/run/fors.scala index cd84649c15..7465b01287 100644 --- a/test/files/run/fors.scala +++ b/test/files/run/fors.scala @@ -13,6 +13,12 @@ object Test extends Application { val ar = "abc".toCharArray + val xml = + <html> + <head><title>Scala</title></head> + <body>{xs}</body> + </html>; + /////////////////// old syntax /////////////////// def testOld { @@ -42,6 +48,11 @@ object Test extends Application { x.toInt > 97) print(x + " "); println for {val x <- ar x.toInt > 97} print(x + " "); println + + // sequences + for (val x <- xml.child) println(x) + for (val x <- xml.child; + x.label == "head") println(x) } /////////////////// new syntax /////////////////// @@ -74,6 +85,10 @@ object Test extends Application { // arrays for (x <- ar) print(x + " "); println + + // sequences + for (x <- xml.child) println(x) + for (x <- xml.child if x.label == "head") println(x) } //////////////////////////////////////////////////// |