package storage import "testing" func TestStatPathEmpty(t *testing.T) { out := StatPath("") if out.Available { t.Error("empty path: Available = true, want false") } if out.Error != "path no configurado" { t.Errorf("empty path: Error = %q, want %q", out.Error, "path no configurado") } } func TestStatPathNonexistent(t *testing.T) { out := StatPath("/nonexistent/path/that/does/not/exist") if out.Available { t.Error("nonexistent path: Available = true, want false") } if out.Error == "" { t.Error("nonexistent path: Error is empty, want non-empty") } } func TestStatPathValid(t *testing.T) { out := StatPath("/tmp") if !out.Available { t.Error("valid path /tmp: Available = false, want true") } if out.TotalBytes == 0 { t.Error("valid path /tmp: TotalBytes = 0, want > 0") } if out.FreeBytes == 0 && out.UsedBytes == 0 { t.Error("valid path /tmp: FreeBytes and UsedBytes both 0, unexpected") } if out.UsedPercent < 0 || out.UsedPercent > 100 { t.Errorf("valid path /tmp: UsedPercent = %f, want 0-100", out.UsedPercent) } }