Skip to content

Commit

Permalink
Adapt REPL tests for the 2.13 stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
smarter committed Aug 14, 2019
1 parent a15b2b1 commit 4762d30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions compiler/test/dotty/tools/repl/ReplCompilerTests.scala
Expand Up @@ -65,7 +65,7 @@ class ReplCompilerTests extends ReplTest {
assertEquals(1, state.imports.size)
run("""mutable.Map("one" -> 1)""")
assertEquals(
"val res0: scala.collection.mutable.Map[String, Int] = Map(one -> 1)",
"val res0: scala.collection.mutable.Map[String, Int] = HashMap(one -> 1)",
storedOutput().trim
)
}
Expand Down Expand Up @@ -115,9 +115,10 @@ class ReplCompilerTests extends ReplTest {
}

@Test def i4051 = fromInitialState { implicit state =>
// FIXME: shouldn't have to pass a type parameter to collect.
val source =
"""val x: PartialFunction[Int, Int] = { case x => x }
|val y = Map(("A", 1), ("B", 2), ("X", 3)).collect { case (k, v) => v }.toList""".stripMargin
|val y = Map(("A", 1), ("B", 2), ("X", 3)).collect[Int] { case (k, v) => v }.toList""".stripMargin

val expected = List(
"val x: PartialFunction[Int, Int] = <function1>",
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/dotty/tools/repl/TabcompleteTests.scala
Expand Up @@ -100,7 +100,7 @@ class TabcompleteTests extends ReplTest {
@Test def importScala = fromInitialState { implicit s =>
val comp = tabComplete("import scala.")
// check that there are no special symbols leaked: <byname>, <special-ops>, ...
assertEquals(comp.find(_.startsWith("<")), None)
assertEquals(comp.find(_.startsWith("<")), Some("<:<"))
assert(!comp.contains("package"))
}

Expand Down

0 comments on commit 4762d30

Please sign in to comment.