Skip to content

Commit

Permalink
Fix a completion test failing on java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
jchyb committed Jan 12, 2024
1 parent b2ba6dc commit 8d1d413
Showing 1 changed file with 52 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,62 @@ class CompletionSnippetSuite extends BaseCompletionSuite:
// Dotty does not currently support fuzzy completions. Please take a look at
// https://github.com/lampepfl/dotty-feature-requests/issues/314
@Test def `type-empty` =
checkSnippet(
"""
|object Main {
| type MyType = List[Int]
| def list : MT@@
|}
|""".stripMargin,
"""|MyType
|""".stripMargin
)
if (scala.util.Properties.isJavaAtLeast("9")) {
checkSnippet(
"""
|object Main {
| type MyType = List[Int]
| def list : MT@@
|}
|""".stripMargin,
"""|MyType
|""".stripMargin
)
} else {
checkSnippet(
"""
|object Main {
| type MyType = List[Int]
| def list : MT@@
|}
|""".stripMargin,
"""|MyType
|MTOM
|MTOMFeature
|""".stripMargin
)
}

// Dotty does not currently support fuzzy completions. Please take a look at
// https://github.com/lampepfl/dotty-feature-requests/issues/314
@Test def `type-new-empty` =
checkSnippet(
"""
|object Main {
| class Gen[T]
| type MyType = Gen[Int]
| new MT@@
|}
|""".stripMargin,
"""|MyType
|""".stripMargin
)
if (scala.util.Properties.isJavaAtLeast("9")) {
checkSnippet(
"""
|object Main {
| class Gen[T]
| type MyType = Gen[Int]
| new MT@@
|}
|""".stripMargin,
"""|MyType
|""".stripMargin
)
} else {
checkSnippet(
"""
|object Main {
| class Gen[T]
| type MyType = Gen[Int]
| new MT@@
|}
|""".stripMargin,
"""|MyType
|MTOM
|MTOMFeature
|""".stripMargin
)
}

@Test def `type` =
checkSnippet(
Expand Down

0 comments on commit 8d1d413

Please sign in to comment.