From f4bd7689a3b6f3e9b0c7f7d666b7da22d605efed Mon Sep 17 00:00:00 2001 From: "E.G" <146701565+GlobalStar117@users.noreply.github.com> Date: Fri, 16 Jan 2026 14:19:30 +1100 Subject: [PATCH] [2.x] test: Migrate FileInfoSpec.scala to verify.BasicTestSuite (#8544) * test: Migrate FileInfoSpec.scala to verify.BasicTestSuite (#8542) Migrate FileInfoSpec.scala from ScalaTest's AnyFlatSpec to verify.BasicTestSuite, following the pattern established by other test files in the util-cache module. Changes: - Replace AnyFlatSpec class with BasicTestSuite object - Convert 'it should ... in' syntax to 'test(...)' syntax - Use Scala 3 syntax with colon indentation - Change === to == for assertions (BasicTestSuite style) - Add explicit Unit return types for consistency - Add 'end FileInfoSpec' marker Fixes #8542 --- util-cache/src/test/scala/FileInfoSpec.scala | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/util-cache/src/test/scala/FileInfoSpec.scala b/util-cache/src/test/scala/FileInfoSpec.scala index f1c9da3be..160f15c67 100644 --- a/util-cache/src/test/scala/FileInfoSpec.scala +++ b/util-cache/src/test/scala/FileInfoSpec.scala @@ -10,24 +10,23 @@ package sbt.util import sjsonnew.shaded.scalajson.ast.unsafe.* import sjsonnew.*, support.scalajson.unsafe.* -import org.scalatest.flatspec.AnyFlatSpec +import verify.BasicTestSuite import sbt.io.IO -class FileInfoSpec extends AnyFlatSpec { +object FileInfoSpec extends BasicTestSuite: val file = new java.io.File(".").getAbsoluteFile val fileInfo: ModifiedFileInfo = FileModified(file, IO.getModifiedTimeOrZero(file)) val filesInfo = FilesInfo(Set(fileInfo)) - it should "round trip" in assertRoundTrip(filesInfo) + test("round trip"): + assertRoundTrip(filesInfo) - def assertRoundTrip[A: JsonWriter: JsonReader](x: A) = { + def assertRoundTrip[A: JsonWriter: JsonReader](x: A): Unit = val jsonString: String = toJsonString(x) val jValue: JValue = Parser.parseUnsafe(jsonString) val y: A = Converter.fromJson[A](jValue).get - assert(x === y) - } - - def assertJsonString[A: JsonWriter](x: A, s: String) = assert(toJsonString(x) === s) + assert(x == y) def toJsonString[A: JsonWriter](x: A): String = CompactPrinter(Converter.toJson(x).get) -} + +end FileInfoSpec