@@ -32,10 +32,11 @@ class BashExitCodeTests:
3232 s " expected $expectedExitCode but got $exitCode${pp(" out" , stdout)}${pp(" err" , stderr)}"
3333 }, expectedExitCode, exitCode)
3434
35- // Helpers for running scala, scalac, and scalac without the output directory ("raw")
35+ // Helpers for running scala, scalac, scalac, and repl without the output directory ("raw")
3636 def scala (args : String * ) = verifyExit(scalaPath, (" --power" +: args :+ " --offline" :+ " --server=false" )* )
3737 def scalacRaw (args : String * ) = verifyExit(scalacPath, args* )
3838 def scalac (args : String * ) = scalacRaw((" -d" +: tmpDir +: args)* )
39+ def repl (args : String * ) = verifyExit(replPath, args* )
3940
4041 /** The path to the test file for this class. */
4142 def f (body : String , suffix : String = " .scala" ): String =
@@ -72,6 +73,8 @@ class BashExitCodeTests:
7273 @ Test def xPluginList = scala(" -Xplugin-list" )(0 )
7374 @ Test def vPhases = scala(" -Vphases" )(0 )
7475
76+ @ Test def replEval = repl(" --repl-eval" , " --repl-init-script" , " println(\" Hello from init script!\" ); val i = 2 * 2" )(0 )
77+
7578 /** A utility for running two commands in a row, like you do in bash. */
7679 extension (inline u1 : Unit ) inline def & (inline u2 : Unit ): Unit = { u1; u2 }
7780end BashExitCodeTests
0 commit comments