test: add unit test for clean exit on 'quit' command in Main

This commit is contained in:
2026-03-22 15:31:02 +01:00
parent 551e08cef3
commit fe39d27d91
@@ -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)