Correct CPU core counts and report incomplete data size scans

This commit is contained in:
2026-11-07 01:38:59 +00:00
parent e579c06b45
commit dbf6398231
2 changed files with 17 additions and 2 deletions
+11
View File
@@ -53,3 +53,14 @@ func TestBoundedSizeSkipsSymlinks(t *testing.T) {
t.Fatalf("size=%d, want 4", got)
}
}
func TestBoundedSizeReportsIncompleteWalk(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
cancel()
if _, err := boundedSize(ctx, t.TempDir(), nil); err != context.Canceled {
t.Fatalf("cancelled size walk error = %v", err)
}
if _, err := boundedSize(context.Background(), filepath.Join(t.TempDir(), "missing"), nil); err == nil {
t.Fatal("missing root must report a partial/unavailable size")
}
}