@@ -252,9 +252,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
252252
253253 {
254254 val resp = remoteServer.buildTargetCompile(new b.CompileParams (targets)).asScala.await
255- val actualStatusCode = resp.getStatusCode
256- val expectedStatusCode = b.StatusCode .OK
257- expect(actualStatusCode == expectedStatusCode)
255+ expect(resp.getStatusCode == b.StatusCode .OK )
258256 }
259257
260258 val compileProducts = os.walk(classDir).filter(os.isFile(_)).map(_.relativeTo(classDir))
@@ -299,9 +297,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
299297
300298 val compileResp =
301299 remoteServer.buildTargetCompile(new b.CompileParams (targets)).asScala.await
302- val actualStatusCode = compileResp.getStatusCode
303- val expectedStatusCode = b.StatusCode .ERROR
304- expect(actualStatusCode == expectedStatusCode)
300+ expect(compileResp.getStatusCode == b.StatusCode .ERROR )
305301
306302 val diagnosticsParams : b.PublishDiagnosticsParams =
307303 extractDiagnosticsParams(root / " Test.scala" , localClient)
@@ -355,9 +351,8 @@ abstract class BspTestDefinitions extends ScalaCliSuite
355351 .buildTargetCompile(new b.CompileParams (targets))
356352 .asScala
357353 .await
358- val actualStatusCode = compileResp.getStatusCode
359- val expectedStatusCode = b.StatusCode .ERROR
360- expect(actualStatusCode == expectedStatusCode)
354+ val actualStatusCode = compileResp.getStatusCode
355+ expect(actualStatusCode == b.StatusCode .ERROR )
361356
362357 val diagnosticsParams = {
363358 val diagnostics = localClient.diagnostics()
@@ -495,8 +490,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
495490 .buildTargetCompile(new b.CompileParams (targets))
496491 .asScala
497492 .await
498- val expectedStatusCode = b.StatusCode .OK
499- expect(compileResp.getStatusCode == expectedStatusCode)
493+ expect(compileResp.getStatusCode == b.StatusCode .OK )
500494
501495 def checkDirectivesInMultipleFilesWarnings (
502496 fileName : String ,
@@ -561,8 +555,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
561555
562556 {
563557 val resp = remoteServer.buildTargetCompile(new b.CompileParams (targets)).asScala.await
564- val expectedStatusCode = b.StatusCode .OK
565- expect(resp.getStatusCode == expectedStatusCode)
558+ expect(resp.getStatusCode == b.StatusCode .OK )
566559 }
567560
568561 {
@@ -602,8 +595,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
602595
603596 {
604597 val resp = remoteServer.buildTargetCompile(new b.CompileParams (targets)).asScala.await
605- val expectedStatusCode = b.StatusCode .OK
606- expect(resp.getStatusCode == expectedStatusCode)
598+ expect(resp.getStatusCode == b.StatusCode .OK )
607599 }
608600
609601 val didChangeParamsOptFuture = Future .firstCompletedOf(Seq (
@@ -673,8 +665,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
673665
674666 {
675667 val resp = remoteServer.buildTargetCompile(new b.CompileParams (targets)).asScala.await
676- val expectedStatusCode = b.StatusCode .OK
677- expect(resp.getStatusCode == expectedStatusCode)
668+ expect(resp.getStatusCode == b.StatusCode .OK )
678669 }
679670
680671 {
@@ -721,8 +712,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
721712
722713 {
723714 val resp = remoteServer.buildTargetCompile(new b.CompileParams (targets)).asScala.await
724- val expectedStatusCode = b.StatusCode .OK
725- expect(resp.getStatusCode == expectedStatusCode)
715+ expect(resp.getStatusCode == b.StatusCode .OK )
726716 }
727717
728718 val didChangeParamsOptFuture = Future .firstCompletedOf(Seq (
@@ -786,8 +776,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
786776
787777 {
788778 val resp = remoteServer.buildTargetCompile(new b.CompileParams (targets)).asScala.await
789- val expectedStatusCode = b.StatusCode .OK
790- expect(resp.getStatusCode == expectedStatusCode)
779+ expect(resp.getStatusCode == b.StatusCode .OK )
791780 }
792781
793782 {
@@ -824,8 +813,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
824813
825814 {
826815 val resp = remoteServer.buildTargetCompile(new b.CompileParams (targets)).asScala.await
827- val expectedStatusCode = b.StatusCode .OK
828- expect(resp.getStatusCode == expectedStatusCode)
816+ expect(resp.getStatusCode == b.StatusCode .OK )
829817 }
830818
831819 expect(changeFuture.isCompleted)
@@ -918,8 +906,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
918906 val resp =
919907 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava))
920908 .asScala.await
921- val expectedErrorStatusCode = b.StatusCode .ERROR
922- expect(resp.getStatusCode == expectedErrorStatusCode)
909+ expect(resp.getStatusCode == b.StatusCode .ERROR )
923910
924911 val dependencyOptions = List (" --dependency" , " com.lihaoyi::os-lib::0.8.0" )
925912 os.proc(TestUtil .cli, " setup-ide" , " ." , dependencyOptions ++ extraOptions)
@@ -938,8 +925,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
938925 val resp0 =
939926 remoteServer.buildTargetCompile(new b.CompileParams (targets0.asJava))
940927 .asScala.await
941- val expectedStatusCode = b.StatusCode .OK
942- expect(resp0.getStatusCode == expectedStatusCode)
928+ expect(resp0.getStatusCode == b.StatusCode .OK )
943929 }
944930 }
945931 }
@@ -971,8 +957,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
971957 val resp =
972958 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava))
973959 .asScala.await
974- val expectedStatusCode = b.StatusCode .ERROR
975- expect(resp.getStatusCode == expectedStatusCode)
960+ expect(resp.getStatusCode == b.StatusCode .ERROR )
976961
977962 val depName = " os-lib"
978963 val depVersion = " 0.8.1"
@@ -1029,8 +1014,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
10291014 val resp =
10301015 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava))
10311016 .asScala.await
1032- val expectedErrorStatusCode = b.StatusCode .ERROR
1033- expect(resp.getStatusCode == expectedErrorStatusCode)
1017+ expect(resp.getStatusCode == b.StatusCode .ERROR )
10341018
10351019 os.proc(TestUtil .cli, " setup-ide" , dir1, dir2, extraOptions)
10361020 .call(
@@ -1048,8 +1032,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
10481032 val resp0 =
10491033 remoteServer.buildTargetCompile(new b.CompileParams (targets0.asJava))
10501034 .asScala.await
1051- val expectedStatusCode = b.StatusCode .OK
1052- expect(resp0.getStatusCode == expectedStatusCode)
1035+ expect(resp0.getStatusCode == b.StatusCode .OK )
10531036 }
10541037 }
10551038
@@ -1073,8 +1056,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
10731056 val resp =
10741057 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava))
10751058 .asScala.await
1076- val expectedStatusCode = b.StatusCode .OK
1077- expect(resp.getStatusCode == expectedStatusCode)
1059+ expect(resp.getStatusCode == b.StatusCode .OK )
10781060
10791061 val reloadResp = remoteServer.workspaceReload().asScala.await
10801062 val responseError = extractWorkspaceReloadResponse(reloadResp).getOrElse {
@@ -1117,8 +1099,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
11171099
11181100 val compileResp =
11191101 remoteServer.buildTargetCompile(new b.CompileParams (targets)).asScala.await
1120- val expectedOkStatusCode = b.StatusCode .OK
1121- expect(compileResp.getStatusCode == expectedOkStatusCode)
1102+ expect(compileResp.getStatusCode == b.StatusCode .OK )
11221103
11231104 // after reload compilation should fail, Utils.scala file contains invalid scala code
11241105 val updatedUtilsFile =
@@ -1132,8 +1113,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
11321113
11331114 val resp0 =
11341115 remoteServer.buildTargetCompile(new b.CompileParams (targets0.asJava)).asScala.await
1135- val expectedStatusCode = b.StatusCode .ERROR
1136- expect(resp0.getStatusCode == expectedStatusCode)
1116+ expect(resp0.getStatusCode == b.StatusCode .ERROR )
11371117 }
11381118 }
11391119 }
@@ -1174,8 +1154,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
11741154
11751155 val errorResponse =
11761156 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava)).asScala.await
1177- val expectedErrorStatusCode = b.StatusCode .ERROR
1178- expect(errorResponse.getStatusCode == expectedErrorStatusCode)
1157+ expect(errorResponse.getStatusCode == b.StatusCode .ERROR )
11791158
11801159 val javacOptions = Seq (
11811160 " --javac-opt" ,
@@ -1202,8 +1181,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
12021181 val okResponse =
12031182 remoteServer.buildTargetCompile(new b.CompileParams (reloadedTargets.asJava))
12041183 .asScala.await
1205- val expectedStatusCode = b.StatusCode .OK
1206- expect(okResponse.getStatusCode == expectedStatusCode)
1184+ expect(okResponse.getStatusCode == b.StatusCode .OK )
12071185 }
12081186 }
12091187
@@ -1245,8 +1223,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
12451223 val resp =
12461224 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava))
12471225 .asScala.await
1248- val expectedStatusCode = b.StatusCode .OK
1249- expect(resp.getStatusCode == expectedStatusCode)
1226+ expect(resp.getStatusCode == b.StatusCode .OK )
12501227
12511228 val updatedSourceFile =
12521229 s """ //> using jvm 19
@@ -1271,8 +1248,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
12711248
12721249 val errorResponse =
12731250 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava)).asScala.await
1274- val expectedOkStatusCode = b.StatusCode .OK
1275- expect(errorResponse.getStatusCode == expectedOkStatusCode)
1251+ expect(errorResponse.getStatusCode == b.StatusCode .OK )
12761252 expect(localClient.logMessages().exists(_.getMessage.startsWith(
12771253 " Error reading API from class file: ReloadTest : java.lang.UnsupportedClassVersionError: ReloadTest has been compiled by a more recent version of the Java Runtime"
12781254 )))
@@ -1339,8 +1315,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
13391315
13401316 val resp =
13411317 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava)).asScala.await
1342- val expectedOkStatusCode = b.StatusCode .OK
1343- expect(resp.getStatusCode == expectedOkStatusCode)
1318+ expect(resp.getStatusCode == b.StatusCode .OK )
13441319 }
13451320 }
13461321 }
@@ -1478,8 +1453,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
14781453 .buildTargetCompile(new b.CompileParams (targets.asJava))
14791454 .asScala
14801455 .await
1481- val expectedOkStatusCode = b.StatusCode .OK
1482- expect(compileResp.getStatusCode == expectedOkStatusCode)
1456+ expect(compileResp.getStatusCode == b.StatusCode .OK )
14831457
14841458 val mainTarget = targets.find(! _.getUri.contains(" -test" )).get
14851459 val runRespFuture =
@@ -1683,8 +1657,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
16831657 .buildTargetCompile(new b.CompileParams (targets))
16841658 .asScala
16851659 .await
1686- val expectedErrorCode = b.StatusCode .ERROR
1687- expect(compileResp.getStatusCode == expectedErrorCode)
1660+ expect(compileResp.getStatusCode == b.StatusCode .ERROR )
16881661
16891662 val diagnosticsParams = {
16901663 val diagnostics = localClient.diagnostics()
@@ -1774,8 +1747,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
17741747 val compileRes = remoteServer.buildTargetCompile(
17751748 new b.CompileParams (List (mainTarget.getId).asJava)
17761749 ).asScala.await
1777- val expectedOkStatusCode = b.StatusCode .OK
1778- expect(compileRes.getStatusCode == expectedOkStatusCode)
1750+ expect(compileRes.getStatusCode == b.StatusCode .OK )
17791751 // ensure that the source jar is in the dependency sources
17801752 val dependencySourcesResp =
17811753 remoteServer
@@ -1849,8 +1821,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
18491821 .buildTargetCompile(new b.CompileParams (targets))
18501822 .asScala
18511823 .await
1852- val expectedOkStatusCode = b.StatusCode .OK
1853- expect(compileResp.getStatusCode == expectedOkStatusCode)
1824+ expect(compileResp.getStatusCode == b.StatusCode .OK )
18541825
18551826 val diagnosticsParams = {
18561827 val diagnostics = localClient.diagnostics()
@@ -1975,11 +1946,10 @@ abstract class BspTestDefinitions extends ScalaCliSuite
19751946 .map(_.getId())
19761947 val compileResult =
19771948 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava)).asScala.await
1978- val expectedOkStatusCode = b.StatusCode .OK
1979- expect(compileResult.getStatusCode == expectedOkStatusCode)
1949+ expect(compileResult.getStatusCode == b.StatusCode .OK )
19801950 val runResult =
19811951 remoteServer.buildTargetRun(new b.RunParams (targets.head)).asScala.await
1982- expect(runResult.getStatusCode == expectedOkStatusCode )
1952+ expect(runResult.getStatusCode == b. StatusCode . OK )
19831953 }
19841954 }
19851955 }
@@ -2013,11 +1983,10 @@ abstract class BspTestDefinitions extends ScalaCliSuite
20131983 .map(_.getId())
20141984 val compileResult =
20151985 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava)).asScala.await
2016- val expectedStatusCode = b.StatusCode .OK
2017- expect(compileResult.getStatusCode == expectedStatusCode)
1986+ expect(compileResult.getStatusCode == b.StatusCode .OK )
20181987 val runResult =
20191988 remoteServer.buildTargetRun(new b.RunParams (targets.head)).asScala.await
2020- expect(runResult.getStatusCode == expectedStatusCode )
1989+ expect(runResult.getStatusCode == b. StatusCode . OK )
20211990 }
20221991 }
20231992 }
@@ -2096,17 +2065,13 @@ abstract class BspTestDefinitions extends ScalaCliSuite
20962065 .map(_.getId())
20972066 val compileResult =
20982067 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava)).asScala.await
2099- if (powerIsSet) {
2100- val expectedStatusCode = b.StatusCode .OK
2101- expect(compileResult.getStatusCode == expectedStatusCode)
2068+ if powerIsSet then {
2069+ expect(compileResult.getStatusCode == b.StatusCode .OK )
21022070 val runResult =
21032071 remoteServer.buildTargetRun(new b.RunParams (targets.head)).asScala.await
2104- expect(runResult.getStatusCode == expectedStatusCode)
2105- }
2106- else {
2107- val expectedStatusCode = b.StatusCode .ERROR
2108- expect(compileResult.getStatusCode == expectedStatusCode)
2072+ expect(runResult.getStatusCode == b.StatusCode .OK )
21092073 }
2074+ else expect(compileResult.getStatusCode == b.StatusCode .ERROR )
21102075 }
21112076 }
21122077 }
@@ -2133,8 +2098,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
21332098 // compilation should fail before reload, as --power mode is off
21342099 val compileBeforeReloadResult =
21352100 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava)).asScala.await
2136- val expectedErrorStatusCode = b.StatusCode .ERROR
2137- expect(compileBeforeReloadResult.getStatusCode == expectedErrorStatusCode)
2101+ expect(compileBeforeReloadResult.getStatusCode == b.StatusCode .ERROR )
21382102
21392103 // enable --power mode via env for setup-ide
21402104 os.proc(TestUtil .cli, " setup-ide" , scriptName, extraOptions)
@@ -2146,13 +2110,12 @@ abstract class BspTestDefinitions extends ScalaCliSuite
21462110 expect(reloadResponse.isEmpty)
21472111 val compileAfterReloadResult =
21482112 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava)).asScala.await
2149- val expectedOkStatusCode = b.StatusCode .OK
2150- expect(compileAfterReloadResult.getStatusCode == expectedOkStatusCode)
2113+ expect(compileAfterReloadResult.getStatusCode == b.StatusCode .OK )
21512114
21522115 // code should also be runnable via BSP now
21532116 val runResult =
21542117 remoteServer.buildTargetRun(new b.RunParams (targets.head)).asScala.await
2155- expect(runResult.getStatusCode == expectedOkStatusCode )
2118+ expect(runResult.getStatusCode == b. StatusCode . OK )
21562119 }
21572120 }
21582121 }
@@ -2190,8 +2153,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
21902153 // compilation should fail before reload, as --power mode is off
21912154 val compileBeforeReloadResult =
21922155 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava)).asScala.await
2193- val expectedErrorStatusCode = b.StatusCode .ERROR
2194- expect(compileBeforeReloadResult.getStatusCode == expectedErrorStatusCode)
2156+ expect(compileBeforeReloadResult.getStatusCode == b.StatusCode .ERROR )
21952157
21962158 // enable --power mode via config
21972159 os.proc(TestUtil .cli, " config" , " power" , " true" )
@@ -2203,13 +2165,12 @@ abstract class BspTestDefinitions extends ScalaCliSuite
22032165 expect(reloadResponse.isEmpty)
22042166 val compileAfterReloadResult =
22052167 remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava)).asScala.await
2206- val expectedOkStatusCode = b.StatusCode .OK
2207- expect(compileAfterReloadResult.getStatusCode == expectedOkStatusCode)
2168+ expect(compileAfterReloadResult.getStatusCode == b.StatusCode .OK )
22082169
22092170 // code should also be runnable via BSP now
22102171 val runResult =
22112172 remoteServer.buildTargetRun(new b.RunParams (targets.head)).asScala.await
2212- expect(runResult.getStatusCode == expectedOkStatusCode )
2173+ expect(runResult.getStatusCode == b. StatusCode . OK )
22132174 }
22142175 }
22152176 }
@@ -2378,8 +2339,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
23782339 .buildTargetCompile(new b.CompileParams (targets.asJava))
23792340 .asScala
23802341 .await
2381- val expectedStatusCode = b.StatusCode .OK
2382- expect(compileResp.getStatusCode == expectedStatusCode)
2342+ expect(compileResp.getStatusCode == b.StatusCode .OK )
23832343 expect(os.read(root / stderrFile).contains(" Scheduling compilation" ))
23842344 }
23852345 }
@@ -2414,8 +2374,7 @@ abstract class BspTestDefinitions extends ScalaCliSuite
24142374 .buildTargetCompile(new b.CompileParams (targets.asJava))
24152375 .asScala
24162376 .await
2417- val expectedStatusCode = b.StatusCode .OK
2418- expect(compileResp.getStatusCode == expectedStatusCode)
2377+ expect(compileResp.getStatusCode == b.StatusCode .OK )
24192378 expect(os.read(root / stderrFile).contains(" Scheduling compilation" ))
24202379 }
24212380 }
0 commit comments