Scala unit testing stdin/stdout
问题 Is it common practice to unit test stdIn/stdOut? If so, then how would you test something like this: import scala.io.StdIn._ object Test { def main(args: Array[String]) = { println("Please input your text. Leaving an empty line will indicate end of the input.") val input = Iterator.continually(readLine()).takeWhile(_ != "").mkString("\n") val result = doSomethingWithInput(input) println("Result:") println(result) } } I'm normally using ScalaTest if that makes any difference. 回答1: Since Scala