Skip to content

Commit

Permalink
Add regression test for issue 18726, release flag is ignored in
Browse files Browse the repository at this point in the history
completions
  • Loading branch information
rochala committed May 2, 2024
1 parent 8825b07 commit 76a68cb
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package dotty.tools.pc.tests.completion

import dotty.tools.pc.base.BaseCompletionSuite

import org.junit.Test
import java.nio.file.Path

class CompletionRelease11Suite extends BaseCompletionSuite:

override protected def scalacOptions(classpath: Seq[Path]): Seq[String] =
"-release:11" +: super.scalacOptions(classpath)

@Test def java11Symbols =
check(
"""
|object A {
| "".repea@@
|}""".stripMargin,
"""repeat(x$0: Int): String
|replaceAll(x$0: String, x$1: String): String
|prependedAll[B >: A](prefix: IterableOnce[B]): IndexedSeq[B]
|prependedAll(prefix: String): String
|prependedAll[B >: Char](prefix: IterableOnce[B]): IndexedSeq[B]
|replaceAllLiterally(literal: String, replacement: String): String
|""".stripMargin
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package dotty.tools.pc.tests.completion

import dotty.tools.pc.base.BaseCompletionSuite

import org.junit.Test
import java.nio.file.Path

class CompletionRelease8Suite extends BaseCompletionSuite:

override protected def scalacOptions(classpath: Seq[Path]): Seq[String] =
"-release:8" +: super.scalacOptions(classpath)

@Test def noJvm11Symbols =
check(
"""
|object A {
| "".repea@@
|}""".stripMargin,
"""replaceAll(x$0: String, x$1: String): String
|prependedAll[B >: A](prefix: IterableOnce[B]): IndexedSeq[B]
|prependedAll(prefix: String): String
|prependedAll[B >: Char](prefix: IterableOnce[B]): IndexedSeq[B]
|replaceAllLiterally(literal: String, replacement: String): String
|""".stripMargin
)

0 comments on commit 76a68cb

Please sign in to comment.