File tree Expand file tree Collapse file tree 3 files changed +23
-19
lines changed Expand file tree Collapse file tree 3 files changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,6 @@ class tests extends CompilerTest {
85
85
val negDir = testsDir + " neg/"
86
86
val runDir = testsDir + " run/"
87
87
val newDir = testsDir + " new/"
88
- val replDir = testsDir + " repl/"
89
88
val javaDir = testsDir + " pos-java-interop/"
90
89
91
90
val sourceDir = " ./src/"
@@ -172,7 +171,6 @@ class tests extends CompilerTest {
172
171
@ Test def pos_utf16 = compileFile(posSpecialDir, " utf16encoded" , explicitUTF16)
173
172
174
173
@ Test def new_all = compileFiles(newDir, twice)
175
- @ Test def repl_all = replFiles(replDir)
176
174
177
175
@ Test def neg_all = compileFiles(negDir, verbose = true , compileSubDirs = false )
178
176
@ Test def neg_typedIdents () = compileDir(negDir, " typedIdents" )
Original file line number Diff line number Diff line change @@ -237,23 +237,6 @@ abstract class CompilerTest {
237
237
}
238
238
}
239
239
240
- def replFile (prefix : String , fileName : String ): Unit = {
241
- val path = s " $prefix$fileName"
242
- val f = new PlainFile (path)
243
- val repl = new TestREPL (new String (f.toCharArray))
244
- repl.process(Array [String ]())
245
- repl.check()
246
- }
247
-
248
- def replFiles (path : String ): Unit = {
249
- val dir = Directory (path)
250
- val fileNames = dir.files.toArray.map(_.jfile.getName).filter(_ endsWith " .check" )
251
- for (name <- fileNames) {
252
- log(s " testing $path$name" )
253
- replFile(path, name)
254
- }
255
- }
256
-
257
240
// ========== HELPERS =============
258
241
259
242
private def expectedErrors (filePaths : List [String ]): List [ErrorsInFile ] = if (filePaths.exists(isNegTest(_))) filePaths.map(getErrors(_)) else Nil
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ package repl
5
5
import core .Contexts .Context
6
6
import collection .mutable
7
7
import java .io .StringWriter
8
+ import dotty .tools .io .{ PlainFile , Directory }
9
+ import org .junit .Test
8
10
9
11
/** A subclass of REPL used for testing.
10
12
* It takes a transcript of a REPL session in `script`. The transcript
@@ -62,3 +64,24 @@ class TestREPL(script: String) extends REPL {
62
64
}
63
65
}
64
66
}
67
+
68
+ class REPLTests {
69
+ def replFile (prefix : String , fileName : String ): Unit = {
70
+ val path = s " $prefix$fileName"
71
+ val f = new PlainFile (path)
72
+ val repl = new TestREPL (new String (f.toCharArray))
73
+ repl.process(Array [String ]())
74
+ repl.check()
75
+ }
76
+
77
+ def replFiles (path : String ): Unit = {
78
+ val dir = Directory (path)
79
+ val fileNames = dir.files.toArray.map(_.jfile.getName).filter(_ endsWith " .check" )
80
+ for (name <- fileNames) {
81
+ println(s " testing $path$name" )
82
+ replFile(path, name)
83
+ }
84
+ }
85
+
86
+ @ Test def replAll = replFiles(" ../tests/repl/" )
87
+ }
You can’t perform that action at this time.
0 commit comments