summaryrefslogtreecommitdiff
path: root/test/disabled/run/script-positions.scala
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-11-02 14:34:35 +0000
committerHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-11-02 14:34:35 +0000
commitb6778be91900b8161e705dc2598ef7af86842b0b (patch)
treed15e8ec18a37eec212f50f1ace27714d7e7d4d34 /test/disabled/run/script-positions.scala
parentac6c76f26d884a94d0c9ff54f055d3f9ab750bac (diff)
downloadscala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.gz
scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.bz2
scala-b6778be91900b8161e705dc2598ef7af86842b0b.zip
Begone t1737...
Diffstat (limited to 'test/disabled/run/script-positions.scala')
-rw-r--r--test/disabled/run/script-positions.scala20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/disabled/run/script-positions.scala b/test/disabled/run/script-positions.scala
index 6982ed8440..2c80d550c0 100644
--- a/test/disabled/run/script-positions.scala
+++ b/test/disabled/run/script-positions.scala
@@ -4,9 +4,9 @@ import util.stringFromStream
// Testing "scripts" without the platform delights which accompany actual scripts.
object Scripts {
- val test1 =
-"""#!/bin/sh
- exec scala $0 $@
+ val test1 =
+"""#!/bin/sh
+ exec scala $0 $@
!#
println("statement 1")
@@ -29,7 +29,7 @@ val x = "line 6"
val y = "line 7"
val z "line 8""""
- val output2 =
+ val output2 =
"""bob.scala:8: error: '=' expected but string literal found.
val z "line 8"
^
@@ -41,10 +41,10 @@ two errors found"""
object Test {
import Scripts._
-
+
def settings = new GenericRunnerSettings(println _)
settings.nocompdaemon.value = true
-
+
def runScript(code: String): String =
stringFromStream(stream =>
Console.withOut(stream) {
@@ -53,7 +53,7 @@ object Test {
}
}
)
-
+
val tests: List[(String, String)] = List(
test1 -> output1,
test2 -> output2
@@ -67,14 +67,14 @@ object Test {
case idx => s drop (idx + 7)
}
def toLines(text: String) = lines(text) map stripFilename
-
+
def main(args: Array[String]): Unit = {
- for ((code, expected) <- tests) {
+ for ((code, expected) <- tests) {
val out = toLines(runScript(code))
val exp = toLines(expected)
val nomatch = out zip exp filter { case (x, y) => x != y }
val success = out.size == exp.size && nomatch.isEmpty
-
+
assert(
success,
"Output doesn't match expected:\n" +