Skip to content

Commit 71ffa5e

Browse files
authored
Remove usage of deprecated * - syntax (com-lihaoyi#253)
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 (scala/scala-dev#769).
1 parent 9090d45 commit 71ffa5e

File tree

1 file changed

+36
-30
lines changed

1 file changed

+36
-30
lines changed

utest/test/src-2/test/utest/AssertsTests.scala

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,46 @@ object AssertsTestsVersionSpecific extends utest.TestSuite{
99
test("failure"){
1010
// Use compileError to check itself to verify that when it
1111
// doesn't throw an error, it actually does (super meta!)
12-
* - compileError("""
13-
compileError("1 + 1").check(
12+
test("1") {
13+
compileError("""
14+
compileError("1 + 1").check(
15+
""
16+
)
17+
""").check(
18+
"""
19+
compileError("1 + 1").check(
20+
^
21+
""",
22+
"compileError check failed to have a compilation error"
23+
)
24+
}
25+
test("2") {
26+
compileError("""
27+
val x = 0
28+
compileError("x + x").check(
1429
""
1530
)
16-
""").check(
17-
"""
18-
compileError("1 + 1").check(
19-
^
20-
""",
21-
"compileError check failed to have a compilation error"
22-
)
23-
* - compileError("""
24-
val x = 0
25-
compileError("x + x").check(
26-
""
31+
""").check(
32+
"""
33+
compileError("x + x").check(
34+
^
35+
""",
36+
"compileError check failed to have a compilation error"
2737
)
38+
}
39+
test("3") {
40+
compileError("""
41+
compileError("1" * 2).check(
42+
""
43+
)
2844
""").check(
29-
"""
30-
compileError("x + x").check(
31-
^
32-
""",
33-
"compileError check failed to have a compilation error"
34-
)
35-
* - compileError("""
36-
compileError("1" * 2).check(
37-
""
38-
)
39-
""").check(
40-
"""
41-
compileError("1" * 2).check(
42-
^
43-
""",
44-
"You can only have literal strings in compileError"
45-
)
45+
"""
46+
compileError("1" * 2).check(
47+
^
48+
""",
49+
"You can only have literal strings in compileError"
50+
)
51+
}
4652

4753
}
4854
test("compileTimeOnly"){

0 commit comments

Comments
 (0)