@@ -16,19 +16,8 @@ import dotty.tools.dotc.reporting.MessageRendering
16
16
import org .junit .{After , Before }
17
17
import org .junit .Assert ._
18
18
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 {
32
21
/** Get the stored output from `out`, resetting the buffer */
33
22
def storedOutput (): String = {
34
23
val output = stripColor(out.toString(StandardCharsets .UTF_8 .name))
@@ -103,3 +92,8 @@ class ReplTest(withStaging: Boolean = false, out: ByteArrayOutputStream = new By
103
92
end if
104
93
}
105
94
}
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