diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-09-28 12:27:34 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-09-29 19:17:58 +0900 |
| commit | d621c53cc1ad96adb36612e6143691dd0c79362b (patch) | |
| tree | 96501187f96d2b91d689707fa649d1da0b97e76b /pkg/pkg_test.go | |
| parent | cfbf2a91f639cac8c6966194c4bbbc0407d96ef8 (diff) | |
pkg: archive extract helper
This exposes the behaviour of curing an archiveArtifact without
requiring a cache. This can be handy and avoids lots of duplicate code.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'pkg/pkg_test.go')
| -rw-r--r-- | pkg/pkg_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/pkg_test.go b/pkg/pkg_test.go index 2d5fdf8e..66639b5b 100644 --- a/pkg/pkg_test.go +++ b/pkg/pkg_test.go @@ -740,6 +740,16 @@ func newWantScrubError(base *check.Absolute) *pkg.ScrubError { } } +// dropFaults removes all fault entries from a cache under testing. +func dropFaults(t *testing.T, base *check.Absolute) { + fault := base.Append("fault") + if err := os.RemoveAll(fault.String()); err != nil { + t.Fatal(err) + } else if err = os.Mkdir(fault.String(), 0); err != nil { + t.Fatal(err) + } +} + func TestCache(t *testing.T) { t.Parallel() |
