Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Sep 28, 2023
1 parent 960cfba commit b5db346
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions tests/unit/src/main/scala/tests/TestingClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ import scala.meta.internal.decorations.PublishDecorationsParams
import scala.meta.internal.metals.Buffers
import scala.meta.internal.metals.ClientCommands
import scala.meta.internal.metals.FileOutOfScalaCliBspScope
import scala.meta.internal.metals.Icons
import scala.meta.internal.metals.Messages._
import scala.meta.internal.metals.MetalsEnrichments._
import scala.meta.internal.metals.ServerCommands
import scala.meta.internal.metals.ServerLivenessMonitor
import scala.meta.internal.metals.TextEdits
import scala.meta.internal.metals.WorkspaceChoicePopup
import scala.meta.internal.metals.clients.language.MetalsInputBoxParams
Expand Down Expand Up @@ -370,6 +372,12 @@ class TestingClient(workspace: AbsolutePath, val buffers: Buffers)
params.getMessage().startsWith(BspErrorHandler.errorHeader)
) {
bspError
} else if (
params.getMessage() == ServerLivenessMonitor
.noResponseParams("Bill", Icons.default)
.logMessage(Icons.default)
) {
new MessageActionItem("ok")
} else {
throw new IllegalArgumentException(params.toString)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ class ServerLivenessMonitorLspSuite extends BaseLspSuite("liveness-monitor") {
Icons.default,
)
_ = assertNoDiff(
server.client.workspaceShowMessages,
noResponseParams.logMessage(Icons.none),
server.client.workspaceMessageRequests,
s"""|${Messages.CheckDoctor.allProjectsMisconfigured}
|${noResponseParams.logMessage(Icons.default)}""".stripMargin,
)
_ = assertEquals(isServerResponsive, Some(false))
_ = Thread.sleep(sleepTime)
Expand Down

0 comments on commit b5db346

Please sign in to comment.