1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-11 00:02:28 +08:00

feat: add GetProcessInfo for system package

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

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)
}