blob: bbb0401941ae5cdc63fb4fb2ebef6911cb902149 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import scala.tools.nsc._
import interpreter.ILoop
object Test {
def main(args : Array[String]) {
val code = """
val n = 2
() => n
"""
val s = new Settings()
s.optimise.value = true
val lines = ILoop.runForTranscript(code + "\n" + code, s).lines.toList
if (lines exists (_ contains "Abandoning crashed session")) {
lines foreach println
println("crashed!")
} else {
println("completed successfully")
}
}
}
|