[2.x] test: Migrate FileStampJsonSpec.scala to verify.BasicTestSuite (#8552)

Co-authored-by: GlobalStar117 <GlobalStar117@users.noreply.github.com>
This commit is contained in:
E.G 2026-01-16 07:01:57 +11:00 committed by GitHub
parent eaea5f83ad
commit 009b0e1276
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 9 deletions

View File

@ -10,14 +10,14 @@ package sbt.internal
import java.nio.file.{ Path, Paths }
import org.scalatest.flatspec.AnyFlatSpec
import verify.BasicTestSuite
import sbt.nio.FileStamp
import sbt.nio.FileStamp.Formats
import sjsonnew.JsonFormat
import sjsonnew.support.scalajson.unsafe.Converter
class FileStampJsonSpec extends AnyFlatSpec {
"file hashes" should "be serializable" in {
object FileStampJsonSpec extends BasicTestSuite:
test("file hashes should be serializable"):
val hashes = Seq(
Paths.get("foo") -> FileStamp.hash("bar"),
Paths.get("bar") -> FileStamp.hash("buzz")
@ -27,8 +27,8 @@ class FileStampJsonSpec extends AnyFlatSpec {
val json = Converter.toJsonUnsafe(hashes)
val deserialized = Converter.fromJsonUnsafe(json)
assert(hashes == deserialized)
}
"file last modified times" should "be serializable" in {
test("file last modified times should be serializable"):
val lastModifiedTimes = Seq(
Paths.get("foo") -> FileStamp.LastModified(1234),
Paths.get("bar") -> FileStamp.LastModified(5678)
@ -38,8 +38,8 @@ class FileStampJsonSpec extends AnyFlatSpec {
val json = Converter.toJsonUnsafe(lastModifiedTimes)
val deserialized = Converter.fromJsonUnsafe(json)
assert(lastModifiedTimes == deserialized)
}
"both" should "be serializable" in {
test("both should be serializable"):
val hashes = Seq(
Paths.get("foo") -> FileStamp.hash("bar"),
Paths.get("bar") -> FileStamp.hash("buzz")
@ -53,5 +53,4 @@ class FileStampJsonSpec extends AnyFlatSpec {
val json = Converter.toJsonUnsafe(both)
val deserialized = Converter.fromJsonUnsafe(json)
assert(both == deserialized)
}
}
end FileStampJsonSpec