Implement idempotent cleanup behavior
This commit is contained in:
@@ -34,6 +34,14 @@ func TestRemoveAllUnderRootRemovesNestedTreeIdempotently(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCleanupRemoveAllUnderRootAcceptsMissingRoot(t *testing.T) {
|
||||
root := filepath.Join(t.TempDir(), "absent")
|
||||
target := filepath.Join(root, "runs", "run-1")
|
||||
if err := RemoveAllUnderRoot(root, target); err != nil {
|
||||
t.Fatalf("RemoveAllUnderRoot() with missing root error = %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemoveAllUnderRootRejectsUnsafeTargets(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
outside := t.TempDir()
|
||||
|
||||
Reference in New Issue
Block a user