MCPcopy Index your code
hub / github.com/celer-pkg/celer / TestDevRestore_DifferentHashMisses

Function TestDevRestore_DifferentHashMisses

pkgcache/cache_dev_artifact_test.go:245–262  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

243}
244
245func TestDevRestore_DifferentHashMisses(t *testing.T) {
246 cache := newTestDevArtifactCache(t)
247 pkgDir := makePackageDir(t, "eigen@3.4.0")
248
249 if err := cache.Store(pkgDir, "meta-content"); err != nil {
250 t.Fatal(err)
251 }
252
253 // Restore with a wrong hash → miss.
254 destDir := filepath.Join(t.TempDir(), "dest")
255 fromPath, err := cache.Restore("eigen@3.4.0", "wrong-hash", destDir)
256 if err != nil {
257 t.Fatalf("unexpected error: %v", err)
258 }
259 if fromPath != "" {
260 t.Error("expected miss for wrong hash")
261 }
262}
263
264func TestDevRestore_OverwritesExistingPackageDir(t *testing.T) {
265 cache := newTestDevArtifactCache(t)

Callers

nothing calls this directly

Calls 5

newTestDevArtifactCacheFunction · 0.85
makePackageDirFunction · 0.85
ErrorMethod · 0.80
StoreMethod · 0.65
RestoreMethod · 0.65

Tested by

no test coverage detected