From 5573dc6dadb6c39fd92430b1f7cf483dae2916eb Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 15 Jun 2021 21:27:05 +0200 Subject: [PATCH] Remove usage of deprecated `* -` syntax This syntax doesn't compile with `-Xsource:3` and thus prevents us from running utest in the Scala 2 community build with this flag enabled (https://github.com/scala/scala-dev/issues/769). --- .../test/src-2/test/utest/AssertsTests.scala | 66 ++++++++++--------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/utest/test/src-2/test/utest/AssertsTests.scala b/utest/test/src-2/test/utest/AssertsTests.scala index 8b33ec8..bc5362b 100644 --- a/utest/test/src-2/test/utest/AssertsTests.scala +++ b/utest/test/src-2/test/utest/AssertsTests.scala @@ -9,40 +9,46 @@ object AssertsTestsVersionSpecific extends utest.TestSuite{ test("failure"){ // Use compileError to check itself to verify that when it // doesn't throw an error, it actually does (super meta!) - * - compileError(""" - compileError("1 + 1").check( + test("1") { + compileError(""" + compileError("1 + 1").check( + "" + ) + """).check( + """ + compileError("1 + 1").check( + ^ + """, + "compileError check failed to have a compilation error" + ) + } + test("2") { + compileError(""" + val x = 0 + compileError("x + x").check( "" ) - """).check( - """ - compileError("1 + 1").check( - ^ - """, - "compileError check failed to have a compilation error" - ) - * - compileError(""" - val x = 0 - compileError("x + x").check( - "" + """).check( + """ + compileError("x + x").check( + ^ + """, + "compileError check failed to have a compilation error" ) + } + test("3") { + compileError(""" + compileError("1" * 2).check( + "" + ) """).check( - """ - compileError("x + x").check( - ^ - """, - "compileError check failed to have a compilation error" - ) - * - compileError(""" - compileError("1" * 2).check( - "" - ) - """).check( - """ - compileError("1" * 2).check( - ^ - """, - "You can only have literal strings in compileError" - ) + """ + compileError("1" * 2).check( + ^ + """, + "You can only have literal strings in compileError" + ) + } } test("compileTimeOnly"){