Add process.Release for unix

Signed-off-by: leongross <leon.gross@9elements.com>
This commit is contained in:
leongross
2024-05-07 17:06:19 +02:00
committed by Ron Evans
parent 3a8ef33c72
commit 3023ba584b
3 changed files with 31 additions and 15 deletions
+12 -15
View File
@@ -12,21 +12,18 @@ import (
func TestFindProcess(t *testing.T) {
// NOTE: For now, we only test the Linux case since only exec_posix.go is currently the only implementation.
if runtime.GOOS == "linux" {
// Linux guarantees that there is pid 0
proc, err := FindProcess(0)
if err != nil {
t.Error("FindProcess(0): wanted err == nil, got %v:", err)
}
if proc.Pid != 0 {
t.Error("Expected pid 0, got: ", proc.Pid)
}
pid0 := Process{Pid: 0}
if *proc != pid0 {
t.Error("Expected &Process{Pid: 0}, got", *proc)
}
// Linux guarantees that there is pid 0
proc, err := FindProcess(0)
if err != nil {
t.Error("FindProcess(0): wanted err == nil, got %v:", err)
}
if proc.Pid != 0 {
t.Error("Expected pid 0, got: ", proc.Pid)
}
pid0 := Process{Pid: 0}
if *proc != pid0 {
t.Error("Expected &Process{Pid: 0}, got", *proc)
}
}