1
- package dotty .tools
1
+ package dotty
2
+ package tools
2
3
package dotc
3
4
package reporting
4
5
5
- import scala . language . unsafeNulls
6
- import java .io .{ BufferedReader , FileInputStream , FileOutputStream , FileReader , PrintStream , PrintWriter , StringReader , StringWriter , File as JFile }
6
+ import java . io .{ File as JFile , * }
7
+ import java .nio . file . Files . readAllLines
7
8
import java .text .SimpleDateFormat
8
9
import java .util .Date
9
- import core .Decorators .*
10
10
11
- import scala .collection .mutable
12
- import scala .jdk .CollectionConverters .*
13
- import util .SourcePosition
14
11
import core .Contexts .*
15
- import Diagnostic .*
16
- import dotty .Properties
12
+ import core .Decorators .*
17
13
import interfaces .Diagnostic .{ERROR , WARNING }
14
+ import io .AbstractFile
15
+ import util .SourcePosition
16
+ import Diagnostic .*
18
17
19
- import scala .io . Codec
18
+ import scala .collection . mutable
20
19
import scala .compiletime .uninitialized
20
+ import scala .io .Codec
21
+ import scala .jdk .CollectionConverters .*
22
+ import scala .language .unsafeNulls
21
23
22
24
class TestReporter protected (outWriter : PrintWriter , logLevel : Int )
23
25
extends Reporter with UniqueMessagePositions with HideNonSensicalMessages with MessageRendering {
@@ -37,6 +39,12 @@ extends Reporter with UniqueMessagePositions with HideNonSensicalMessages with M
37
39
final def setSkip (): Unit = _skip = true
38
40
final def skipped : Boolean = _skip
39
41
42
+ override protected def renderPath (file : AbstractFile ): String =
43
+ if JFile .separatorChar == '\\ ' then
44
+ file.path.replace('\\ ' , '/' )
45
+ else
46
+ file.path
47
+
40
48
protected final def inlineInfo (pos : SourcePosition )(using Context ): String =
41
49
if (pos.exists) {
42
50
if (pos.outer.exists)
@@ -152,7 +160,7 @@ object TestReporter {
152
160
Properties .rerunFailed &&
153
161
failedTestsFile.exists() &&
154
162
failedTestsFile.isFile
155
- )(java.nio.file. Files . readAllLines(failedTestsFile.toPath).asScala.toList)
163
+ )(readAllLines(failedTestsFile.toPath).asScala.toList)
156
164
157
165
def writeFailedTests (tests : List [String ]): Unit =
158
166
initLog()
0 commit comments