@@ -32,10 +32,11 @@ class BashExitCodeTests:
32
32
s " expected $expectedExitCode but got $exitCode${pp(" out" , stdout)}${pp(" err" , stderr)}"
33
33
}, expectedExitCode, exitCode)
34
34
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")
36
36
def scala (args : String * ) = verifyExit(scalaPath, (" --power" +: args :+ " --offline" :+ " --server=false" )* )
37
37
def scalacRaw (args : String * ) = verifyExit(scalacPath, args* )
38
38
def scalac (args : String * ) = scalacRaw((" -d" +: tmpDir +: args)* )
39
+ def repl (args : String * ) = verifyExit(replPath, args* )
39
40
40
41
/** The path to the test file for this class. */
41
42
def f (body : String , suffix : String = " .scala" ): String =
@@ -72,6 +73,8 @@ class BashExitCodeTests:
72
73
@ Test def xPluginList = scala(" -Xplugin-list" )(0 )
73
74
@ Test def vPhases = scala(" -Vphases" )(0 )
74
75
76
+ @ Test def replEval = repl(" --repl-eval" , " --repl-init-script" , " println(\" Hello from init script!\" ); val i = 2 * 2" )(0 )
77
+
75
78
/** A utility for running two commands in a row, like you do in bash. */
76
79
extension (inline u1 : Unit ) inline def & (inline u2 : Unit ): Unit = { u1; u2 }
77
80
end BashExitCodeTests
0 commit comments