1
0
forked from rosa/hakurei

internal/pkg: rename archive checksum helpers

These names are more consistent with other helper names, so rename them while the API is still internal.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-06-04 14:13:20 +09:00
parent 4d04f86f4a
commit 729be19af3
6 changed files with 20 additions and 19 deletions
+5 -5
View File
@@ -357,7 +357,7 @@ type expectsFS fstest.MapFS
// hash computes the checksum of e.
func (e expectsFS) hash() (checksum pkg.Checksum) {
if err := pkg.HashFS(&checksum, fstest.MapFS(e), "."); err != nil {
if err := pkg.SumFS(&checksum, fstest.MapFS(e), "."); err != nil {
panic(err)
}
return
@@ -561,8 +561,8 @@ func checkWithCache(t *testing.T, testCases []cacheTestCase) {
want := tc.want.hash()
var checksum pkg.Checksum
if err := pkg.HashDir(&checksum, base); err != nil {
t.Fatalf("HashDir: error = %v", err)
if err := pkg.SumDir(&checksum, base); err != nil {
t.Fatalf("SumDir: error = %v", err)
} else if checksum != want {
t.Fatal(expectsFrom(base.String()))
}
@@ -581,8 +581,8 @@ func checkWithCache(t *testing.T, testCases []cacheTestCase) {
}
// validate again to make sure scrub did not condemn anything
if err := pkg.HashDir(&checksum, base); err != nil {
t.Fatalf("HashDir: error = %v", err)
if err := pkg.SumDir(&checksum, base); err != nil {
t.Fatalf("SumDir: error = %v", err)
} else if checksum != want {
t.Fatalf("(scrubbed) %s", expectsFrom(base.String()))
}