feat: add GetProcessInfo for system package

This commit is contained in:
dudaodong committed 2024-09-13 16:10:09 +08:00
1 parent e58c9b797b
commit 2bbcb85286
5 files changed
+261 -1

No files matched your search

+17
View File
@@ -4,6 +4,7 @@ import (
"os/exec"
"strings"
"testing"
"time"
"github.com/duke-git/lancet/v2/internal"
)
@@ -125,3 +126,19 @@ func TestStopProcess(t *testing.T) {
err = StopProcess(pid)
assert.IsNil(err)
}
func TestGetProcessInfo(t *testing.T) {
t.Parallel()
assert := internal.NewAssert(t, "TestGetProcessInfo")
pid, err := StartProcess("ls", "-a")
assert.IsNil(err)
time.Sleep(1 * time.Second)
processInfo, err := GetProcessInfo(pid)
assert.IsNil(err)
t.Log(processInfo)
}