feat: harden workspace file APIs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
tao.chen
2026-07-02 17:22:26 +08:00
co-authored by Claude Fable 5
parent c1b8982e3b
commit 04b309d3fc
18 changed files with 1262 additions and 76 deletions
+9
View File
@@ -135,3 +135,12 @@ func TestLocalFSListSorted(t *testing.T) {
t.Errorf("List not sorted: %v", names)
}
}
func TestLocalFSRejectsRemoveRoot(t *testing.T) {
fsys := NewLocal(t.TempDir())
for _, path := range []string{"", "."} {
if err := fsys.Remove(path); err == nil {
t.Fatalf("Remove(%q) expected error", path)
}
}
}