From 94c5fe2a615dfe376f28f05e79f3e638bdff3893 Mon Sep 17 00:00:00 2001 From: Piotr Chabelski Date: Thu, 12 Dec 2024 13:19:01 +0100 Subject: [PATCH] Test for correct number of deprecation warnings when commas are used as separators for using directive values --- .../scala/scala/cli/integration/RunTestsDefault.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/integration/src/test/scala/scala/cli/integration/RunTestsDefault.scala b/modules/integration/src/test/scala/scala/cli/integration/RunTestsDefault.scala index 9816e4012d..4a08471b5d 100644 --- a/modules/integration/src/test/scala/scala/cli/integration/RunTestsDefault.scala +++ b/modules/integration/src/test/scala/scala/cli/integration/RunTestsDefault.scala @@ -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) } } }