//go:build darwin

package proc

import (
	"os"
	"testing"
)

func TestProcessByPID(t *testing.T) {
	process, ok := ProcessByPID(os.Getpid())
	if !ok {
		t.Fatal("ProcessByPID did not find the current process")
	}
	if process.PID != os.Getpid() {
		t.Fatalf("PID = %d, want %d", process.PID, os.Getpid())
	}
	if process.PGID <= 0 {
		t.Fatalf("PGID = %d, want a positive process group ID", process.PGID)
	}
	if process.StartedAt.IsZero() {
		t.Fatal("StartedAt is zero")
	}
}
