Skip to content

Fixes #7051 Detect typos in neg tests and give a warning #7062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions compiler/test/dotty/tools/vulpix/ParallelTesting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -658,13 +658,20 @@ trait ParallelTesting extends RunnerOrchestration { self =>
if (errors > 0)
errorMap.put(s"${file.getPath}:${lineNbr}", errors)


val noposErrors = line.sliding("// nopos-error".length).count(_.mkString == "// nopos-error")
if (noposErrors > 0) {
val nopos = errorMap.get("nopos")
val existing: Integer = if (nopos eq null) 0 else nopos
errorMap.put("nopos", noposErrors + existing)
}

val possibleTypos = List("//error" -> "// error" , "//nopos-error" -> "// nopos-error")
for ((possibleTypo, expected) <- possibleTypos) {
if (line.contains(possibleTypo))
echo(s"Warning: Possible typo in error tag in file ${file.getCanonicalPath}:$lineNbr: found `$possibleTypo` but expected `$expected`")
}

expectedErrors += noposErrors + errors
}
}
Expand Down