diff options
Diffstat (limited to 'test/junit')
-rw-r--r-- | test/junit/scala/tools/nsc/interpreter/CompletionTest.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala index 534d5ddc3a..5b35c37c7f 100644 --- a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala +++ b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala @@ -133,6 +133,15 @@ class CompletionTest { checkExact(completer, " 1.toHexString //print")(EmptyString, "scala.Predef.intWrapper(1).toHexString // : String") } + @Test + def firstCompletionWithNoPrefixHidesUniversalMethodsAndExtensionMethods(): Unit = { + val intp = newIMain() + val completer = new PresentationCompilerCompleter(intp) + checkExact(completer, "case class C(a: Int, b: Int) { this.")("a", "b") + assert(Set("asInstanceOf", "==").diff(completer.complete("case class C(a: Int, b: Int) { this.").candidates.toSet).isEmpty) + checkExact(completer, "case class D(a: Int, b: Int) { this.a")("a", "asInstanceOf") + } + def checkExact(completer: PresentationCompilerCompleter, before: String, after: String = "")(expected: String*): Unit = { assertEquals(expected.toSet, completer.complete(before, after).candidates.toSet) } |