Skip to content

Commit

Permalink
test: single-file-config
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Sep 13, 2023
1 parent 30b07a1 commit d7be734
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/slow/src/test/scala/tests/scalacli/ScalaCliSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,10 @@ class ScalaCliSuite extends BaseScalaCliSuite(V.scala3) {
"File: SomeFile.scala"
)
def workspaceMsgs =
(server.client.messageRequests.asScala ++ server.client.showMessages.asScala
.map(_.getMessage()))
.collect {
case `msg` => msg
case msg @ "scala-cli bspConfig" => msg
}
server.client.messageRequests.asScala
.filter(
_ != "scala-cli bspConfig"
) // to achieve the same behavior no matter if scala-cli in installed or not
.mkString("\n")
def hasBuildTarget(fileName: String) = server.server.buildTargets
.inverseSources(workspace.resolve(fileName))
Expand Down Expand Up @@ -421,15 +419,15 @@ class ScalaCliSuite extends BaseScalaCliSuite(V.scala3) {
_ <- server.server.buildServerPromise.future
_ = assertNoDiff(
workspaceMsgs,
List(msg, msg, "scala-cli bspConfig").mkString("\n"),
List(msg, msg).mkString("\n"),
)
_ = assert(hasBuildTarget("src/Main.scala"))
_ = assert(hasBuildTarget("SomeFile.scala"))

_ <- server.didOpen("SomeFile.scala")
_ = assertNoDiff(
workspaceMsgs,
List(msg, msg, "scala-cli bspConfig").mkString("\n"),
List(msg, msg).mkString("\n"),
)
} yield ()
}
Expand Down

0 comments on commit d7be734

Please sign in to comment.