@@ -16,19 +16,8 @@ import dotty.tools.dotc.reporting.MessageRendering
1616import org .junit .{After , Before }
1717import org .junit .Assert ._
1818
19-
20- class ReplTest (withStaging : Boolean = false , out : ByteArrayOutputStream = new ByteArrayOutputStream ) extends ReplDriver (
21- Array (
22- " -classpath" ,
23- if (withStaging)
24- TestConfiguration .withStagingClasspath
25- else
26- TestConfiguration .basicClasspath,
27- " -color:never" ,
28- " -Yerased-terms" ,
29- ),
30- new PrintStream (out, true , StandardCharsets .UTF_8 .name)
31- ) with MessageRendering {
19+ class ReplTest (options : Array [String ] = ReplTest .defaultOptions, out : ByteArrayOutputStream = new ByteArrayOutputStream )
20+ extends ReplDriver (options, new PrintStream (out, true , StandardCharsets .UTF_8 .name)) with MessageRendering {
3221 /** Get the stored output from `out`, resetting the buffer */
3322 def storedOutput (): String = {
3423 val output = stripColor(out.toString(StandardCharsets .UTF_8 .name))
@@ -103,3 +92,8 @@ class ReplTest(withStaging: Boolean = false, out: ByteArrayOutputStream = new By
10392 end if
10493 }
10594}
95+
96+ object ReplTest :
97+ val commonOptions = Array (" -color:never" , " -Yerased-terms" )
98+ val defaultOptions = commonOptions ++ Array (" -classpath" , TestConfiguration .basicClasspath)
99+ lazy val withStagingOptions = commonOptions ++ Array (" -classpath" , TestConfiguration .withStagingClasspath)
0 commit comments