Skip to content

Commit c52db23

Browse files
committed
chore: fix tests
1 parent 2baa8dd commit c52db23

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

frontend/src/test/scala/bloop/bsp/BspCompileSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class BspCompileSpec(
3737
// Filter out the initialize request that contains platform-specific details
3838
assertNoDiff(
3939
allButInitializeRequest.mkString(lineSeparator),
40-
s"""| --> content: {"result":{"displayName":"${BuildInfo.bloopName}","version":"${BuildInfo.version}","bspVersion":"${BuildInfo.bspVersion}","capabilities":{"compileProvider":{"languageIds":["scala","java"]},"testProvider":{"languageIds":["scala","java"]},"runProvider":{"languageIds":["scala","java"]},"inverseSourcesProvider":true,"dependencySourcesProvider":true,"resourcesProvider":true,"buildTargetChangedProvider":false,"jvmTestEnvironmentProvider":true,"jvmRunEnvironmentProvider":true,"canReload":false}},"id":2,"jsonrpc":"2.0"}
40+
s"""| --> content: ${TestConstants.buildInitialize}
4141
| --> content: {"method":"build/initialized","params":{},"jsonrpc":"2.0"}
4242
| --> content: {"method":"build/shutdown","params":{},"id":3,"jsonrpc":"2.0"}
4343
| --> content: {"result":{},"id":3,"jsonrpc":"2.0"}

frontend/src/test/scala/bloop/bsp/BspConnectionSpec.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import scala.concurrent.duration.FiniteDuration
44

55
import bloop.cli.BspProtocol
66
import bloop.cli.ExitStatus
7-
import bloop.internal.build.BuildInfo
87
import bloop.io.Environment.lineSeparator
98
import bloop.logging.BspClientLogger
109
import bloop.logging.RecordingLogger
@@ -95,7 +94,7 @@ class BspConnectionSpec(
9594
assertNoDiff(
9695
allButInitializeRequest.mkString(lineSeparator),
9796
s"""|
98-
| --> content: {"result":{"displayName":"${BuildInfo.bloopName}","version":"${BuildInfo.version}","bspVersion":"${BuildInfo.bspVersion}","capabilities":{"compileProvider":{"languageIds":["scala","java"]},"testProvider":{"languageIds":["scala","java"]},"runProvider":{"languageIds":["scala","java"]},"inverseSourcesProvider":true,"dependencySourcesProvider":true,"resourcesProvider":true,"buildTargetChangedProvider":false,"jvmTestEnvironmentProvider":true,"jvmRunEnvironmentProvider":true,"canReload":false}},"id":2,"jsonrpc":"2.0"}
97+
| --> content: ${TestConstants.buildInitialize}
9998
| --> content: {"method":"build/initialized","params":{},"jsonrpc":"2.0"}""".stripMargin
10099
)
101100
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package bloop.bsp
2+
3+
import bloop.internal.build.BuildInfo
4+
5+
object TestConstants {
6+
val buildInitialize: String = raw"""
7+
{
8+
"result": {
9+
"displayName": "${BuildInfo.bloopName}",
10+
"version": "${BuildInfo.version}",
11+
"bspVersion": "${BuildInfo.bspVersion}",
12+
"capabilities": {
13+
"compileProvider": { "languageIds": ["scala", "java"] },
14+
"testProvider": { "languageIds": ["scala", "java"] },
15+
"runProvider": { "languageIds": ["scala", "java"] },
16+
"debugProvider": { "languageIds": ["scala", "java"] },
17+
"inverseSourcesProvider": true,
18+
"dependencySourcesProvider": true,
19+
"resourcesProvider": true,
20+
"buildTargetChangedProvider": false,
21+
"jvmTestEnvironmentProvider": true,
22+
"jvmRunEnvironmentProvider": true,
23+
"canReload": false
24+
}
25+
},
26+
"id": 2,
27+
"jsonrpc": "2.0"
28+
}
29+
""".replaceAll("\\s", "")
30+
}

0 commit comments

Comments
 (0)