Skip to content

Commit 7362330

Browse files
committed
Change test as mention on PR
1 parent 8c3af12 commit 7362330

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

compiler/src/dotty/tools/dotc/util/NameTransformer.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ object NameTransformer {
5454
else name
5555
}
5656

57+
def encodeString(name: String): String = name.map{ch =>
58+
lazy val repl = op2code(ch)
59+
if (ch <= nops && repl != null)
60+
repl
61+
else ch
62+
}.toString()
63+
5764
/** Replace operator symbols by corresponding expansion strings.
5865
*
5966
* @param name the string to encode

compiler/test/dotty/tools/repl/TabcompleteTests.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ class TabcompleteTests extends ReplTest {
2929
comp.suggestions.sorted == List("slice", "sliding"))
3030
}
3131

32-
@Test def classModuleHiding: Unit =
33-
fromInitialState{ implicit s => assert(tabComplete("scala.Predef").suggestions.isEmpty) }
32+
@Test def tabCompleteModule: Unit =
33+
fromInitialState{ implicit s =>
34+
val comp = tabComplete("scala.Pred").suggestions
35+
assertTrue(s""""Expected single element "Predef" got: ${comp}""",
36+
comp == List("Predef"))
37+
}
3438

3539
@Test def autoCompleteValAssign: Unit =
3640
fromInitialState { implicit s => tabComplete("val x = 5") }

0 commit comments

Comments
 (0)