Skip to content

Commit

Permalink
Test for correct number of deprecation warnings when commas are used …
Browse files Browse the repository at this point in the history
…as separators for using directive values
  • Loading branch information
Gedochao committed Dec 12, 2024
1 parent bd247d6 commit 94c5fe2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,16 @@ class RunTestsDefault extends RunTestDefinitions
) {
val inputPath = os.rel / "example.sc"
TestInputs(inputPath ->
"""//> using options -Werror, -Wconf:cat=deprecation:e
"""//> using options -Werror, -Wconf:cat=deprecation:e, -Wconf:cat=unused:e
|println("Deprecation warnings should have been printed")
|""".stripMargin)
.fromRoot { root =>
val res = os.proc(TestUtil.cli, "run", extraOptions, inputPath)
.call(cwd = root, stderr = os.Pipe)
val err = res.err.trim()
expect(err.contains("Use of commas as separators is deprecated"))
val err = res.err.trim()
val expectedWarning = "Use of commas as separators is deprecated"
expect(err.contains(expectedWarning))
expect(err.linesIterator.count(_.contains(expectedWarning)) == 2)
}
}
}

0 comments on commit 94c5fe2

Please sign in to comment.