test: add unit test for clean exit on 'quit' command in Main
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package de.nowchess.chess.main
|
||||
|
||||
import de.nowchess.chess.Main
|
||||
import java.io.ByteArrayInputStream
|
||||
import org.scalatest.funsuite.AnyFunSuite
|
||||
import org.scalatest.matchers.should.Matchers
|
||||
|
||||
class MainTest extends AnyFunSuite with Matchers:
|
||||
|
||||
test("main exits cleanly when 'quit' is entered"):
|
||||
scala.Console.withIn(ByteArrayInputStream("quit\n".getBytes("UTF-8"))):
|
||||
Main.main(Array.empty)
|
||||
Reference in New Issue
Block a user