Skip to content

Commit 8d1d413

Browse files
committed
Fix a completion test failing on java 8
1 parent b2ba6dc commit 8d1d413

File tree

1 file changed

+52
-21
lines changed

1 file changed

+52
-21
lines changed

presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSnippetSuite.scala

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -77,31 +77,62 @@ class CompletionSnippetSuite extends BaseCompletionSuite:
7777
// Dotty does not currently support fuzzy completions. Please take a look at
7878
// https://github.com/lampepfl/dotty-feature-requests/issues/314
7979
@Test def `type-empty` =
80-
checkSnippet(
81-
"""
82-
|object Main {
83-
| type MyType = List[Int]
84-
| def list : MT@@
85-
|}
86-
|""".stripMargin,
87-
"""|MyType
88-
|""".stripMargin
89-
)
80+
if (scala.util.Properties.isJavaAtLeast("9")) {
81+
checkSnippet(
82+
"""
83+
|object Main {
84+
| type MyType = List[Int]
85+
| def list : MT@@
86+
|}
87+
|""".stripMargin,
88+
"""|MyType
89+
|""".stripMargin
90+
)
91+
} else {
92+
checkSnippet(
93+
"""
94+
|object Main {
95+
| type MyType = List[Int]
96+
| def list : MT@@
97+
|}
98+
|""".stripMargin,
99+
"""|MyType
100+
|MTOM
101+
|MTOMFeature
102+
|""".stripMargin
103+
)
104+
}
90105

91106
// Dotty does not currently support fuzzy completions. Please take a look at
92107
// https://github.com/lampepfl/dotty-feature-requests/issues/314
93108
@Test def `type-new-empty` =
94-
checkSnippet(
95-
"""
96-
|object Main {
97-
| class Gen[T]
98-
| type MyType = Gen[Int]
99-
| new MT@@
100-
|}
101-
|""".stripMargin,
102-
"""|MyType
103-
|""".stripMargin
104-
)
109+
if (scala.util.Properties.isJavaAtLeast("9")) {
110+
checkSnippet(
111+
"""
112+
|object Main {
113+
| class Gen[T]
114+
| type MyType = Gen[Int]
115+
| new MT@@
116+
|}
117+
|""".stripMargin,
118+
"""|MyType
119+
|""".stripMargin
120+
)
121+
} else {
122+
checkSnippet(
123+
"""
124+
|object Main {
125+
| class Gen[T]
126+
| type MyType = Gen[Int]
127+
| new MT@@
128+
|}
129+
|""".stripMargin,
130+
"""|MyType
131+
|MTOM
132+
|MTOMFeature
133+
|""".stripMargin
134+
)
135+
}
105136

106137
@Test def `type` =
107138
checkSnippet(

0 commit comments

Comments
 (0)