@@ -10,6 +10,7 @@ import scala.cli.commands.fmt.{FmtOptions, FmtUtil}
10
10
import scala .cli .commands .update .Update .Release
11
11
12
12
class ScalafmtTests extends munit.FunSuite {
13
+ private lazy val defaultScalafmtVersion = Constants .defaultScalafmtVersion
13
14
14
15
test(" readVersionFromFile with non-default scalafmt version" ) {
15
16
val confFile = """ runner.dialect = scala213
@@ -34,27 +35,25 @@ class ScalafmtTests extends munit.FunSuite {
34
35
}
35
36
}
36
37
37
- test(" check native launcher availability for scalafmt" ) {
38
+ test(s " check native launcher availability for scalafmt $defaultScalafmtVersion " ) {
38
39
final case class Asset (name : String )
39
40
final case class Release (tag_name : String , assets : List [Asset ])
40
41
lazy val releaseCodec : JsonValueCodec [Release ] = JsonCodecMaker .make
41
-
42
- val scalaFmtVersion = Constants .defaultScalafmtVersion
43
42
val url =
44
- s " https://api.github.com/repos/virtuslab /scalafmt-native-image /releases/tags/v $scalaFmtVersion "
43
+ s " https://api.github.com/repos/scalameta /scalafmt/releases/tags/v $defaultScalafmtVersion "
45
44
46
45
val expectedAssets = Seq (
47
- " scalafmt-x86_64-apple-darwin.gz " ,
48
- " scalafmt-x86_64-pc-linux-mostly-static.gz " ,
49
- " scalafmt-x86_64-pc-linux-static.gz " ,
50
- " scalafmt-x86_64-pc-linux.gz " ,
51
- " scalafmt-x86_64 -pc-win32 .zip"
46
+ " scalafmt-x86_64-apple-darwin.zip " ,
47
+ " scalafmt-x86_64-pc-linux.zip " ,
48
+ " scalafmt-x86_64-pc-win32.zip " ,
49
+ " scalafmt-aarch64-apple-darwin.zip " ,
50
+ " scalafmt-aarch64 -pc-linux .zip"
52
51
)
53
52
val errorMsg =
54
- s """ scalafmt native images missing for v $scalaFmtVersion , make a release at https://github.com/VirtusLab /scalafmt-native-image
53
+ s """ scalafmt native images missing for v $defaultScalafmtVersion at https://github.com/scalameta /scalafmt
55
54
|Ensure that all expected assets are available in the release:
56
55
| ${expectedAssets.mkString(" , " )}
57
- |for scalafmt-native-image under tag v $scalaFmtVersion . """ .stripMargin
56
+ |under tag v $defaultScalafmtVersion . """ .stripMargin
58
57
try {
59
58
val resp = TestUtil .downloadFile(url).orThrow
60
59
val release = readFromArray(resp)(releaseCodec)
@@ -68,7 +67,7 @@ class ScalafmtTests extends munit.FunSuite {
68
67
catch {
69
68
case e : JsonReaderException => throw new Exception (s " Error reading $url" , e)
70
69
case e : Throwable => throw new Exception (
71
- s """ Failed to check for the ScalaFmt native launcher assets: ${e.getMessage}
70
+ s """ Failed to check for the ScalaFmt $defaultScalafmtVersion native launcher assets: ${e.getMessage}
72
71
|
73
72
| $errorMsg
74
73
| """ .stripMargin,
0 commit comments