Add interactive snapshot comparison, CLI tests and treegen

--compare opens the TUI with growth/shrink colouring unless a report is
requested. treegen builds deterministic synthetic trees (Unicode,
hostile names, sparse files). MAPSIZE_DEBUG_PANIC verifies terminal
restoration on UI and scanner panics.
This commit is contained in:
Andy Dixon
2026-10-02 08:28:52 +01:00
parent df8b10c6dd
commit 0e5b9f7cc3
10 changed files with 288 additions and 20 deletions
+6 -5
View File
@@ -93,6 +93,12 @@ func runReport(cfg *Config) error {
if s != nil {
waitWithProgress(s, cfg.Stderr)
}
if cfg.Duplicates && !cfg.JSON && !cfg.CSV {
// Find takes its own read lock; never nest RLock.
if err := runDuplicates(ctx, cfg, t); err != nil {
return err
}
}
t.RLock()
defer t.RUnlock()
if s != nil && cfg.Save != "" {
@@ -108,11 +114,6 @@ func runReport(cfg *Config) error {
case cfg.CSV:
return export.CSV(out, t, t.Root(), cfg.Depth)
}
if cfg.Duplicates {
if err := runDuplicates(ctx, cfg, t); err != nil {
return err
}
}
if cfg.Top > 0 {
ids := t.SortedChildren(t.Root(), cfg.SizeMode)
if len(ids) > cfg.Top {