Files
Privatae e4c9b69b46
ci / personal-data (push) Successful in 5s
ci / test (push) Successful in 3m4s
ci / fuzz (push) Successful in 3m45s
bastion 0.53.2
2026-10-20 04:42:14 +00:00

17 lines
534 B
Go

//go:build darwin
package main
import "testing"
func TestParsePSFacts(t *testing.T) {
out := " 1 0 ?? /sbin/launchd\n 420 1 ?? /usr/local/bin/python3\n 2002 2001 ttys003 /usr/local/bin/claude\n"
m := parsePSFacts(out)
if f := m[420]; f.PPID != 1 || f.Interactive || f.Comm != "python3" || f.Exe != "/usr/local/bin/python3" {
t.Errorf("parsePSFacts(420) = %+v", f)
}
if f := m[2002]; !f.Interactive || f.Detail != "tty ttys003" || f.Comm != "claude" {
t.Errorf("parsePSFacts(2002) = %+v", f)
}
}