Skip to content

Commit ff5577f

Browse files
test: added test for GetProcessDetails
1 parent b327541 commit ff5577f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pkg/procInfo_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,18 @@ func TestGetProcList(t *testing.T) {
3636
assert.Equal(t, expected, got[0])
3737

3838
}
39+
40+
func TestGetProcDetails(t *testing.T) {
41+
var _ Loader = (*spyProcLoader)(nil)
42+
got, err := getProcessDetails(5, &spyProcLoader{})
43+
if err != nil {
44+
t.Errorf("%v", err)
45+
}
46+
expected := ProcessDetails{
47+
PPID: 2,
48+
State: "R (Running)",
49+
Tgid: 4085954,
50+
}
51+
assert.Equal(t, expected, got)
52+
53+
}

0 commit comments

Comments
 (0)