diff options
Diffstat (limited to 'internal/pkg/pkg_test.go')
| -rw-r--r-- | internal/pkg/pkg_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/pkg/pkg_test.go b/internal/pkg/pkg_test.go index 700aa962..f8a72564 100644 --- a/internal/pkg/pkg_test.go +++ b/internal/pkg/pkg_test.go @@ -314,6 +314,11 @@ func checkWithCache(t *testing.T, testCases []cacheTestCase) { t.Fatal(err) } + // destroy non-deterministic status files + if err := os.RemoveAll(base.Append("status").String()); err != nil { + t.Fatal(err) + } + var checksum pkg.Checksum if err := pkg.HashDir(&checksum, base); err != nil { t.Fatalf("HashDir: error = %v", err) @@ -382,6 +387,9 @@ func cureMany(t *testing.T, c *pkg.Cache, steps []cureStep) { } else if step.pathname != ignorePathname && !pathname.Is(step.pathname) { t.Fatalf("Cure: pathname = %q, want %q", pathname, step.pathname) } else if checksum != makeChecksumH(step.checksum) { + if checksum == (unique.Handle[pkg.Checksum]{}) { + checksum = unique.Make(pkg.Checksum{}) + } t.Fatalf( "Cure: checksum = %s, want %s", pkg.Encode(checksum.Value()), pkg.Encode(step.checksum), |
