Skip to content

Commit 7cf5568

Browse files
committed
Update checkfiles is success & rm out file
1 parent 3d8472c commit 7cf5568

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/test/dotty/tools/vulpix/FileDiff.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,12 @@ object FileDiff {
6767
val outFilePath = checkFilePath + ".out"
6868
FileDiff.check(sourceTitle, actualLines, checkFilePath) match {
6969
case Some(msg) if dotty.Properties.testsUpdateCheckfile =>
70-
FileDiff.dump(checkFilePath, actualLines)
70+
Files.deleteIfExists(Paths.get(outFilePath))
71+
if actualLines.isEmpty
72+
then Files.deleteIfExists(Paths.get(checkFilePath))
73+
else FileDiff.dump(checkFilePath, actualLines)
7174
println("Updated checkfile: " + checkFilePath)
72-
false
75+
true
7376
case Some(msg) =>
7477
FileDiff.dump(outFilePath, actualLines)
7578
println(msg)

0 commit comments

Comments
 (0)