MCPcopy Create free account
hub / github.com/prometheus/procfs / TestExecutable

Function TestExecutable

proc_test.go:121–141  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

119}
120
121func TestExecutable(t *testing.T) {
122 for _, tt := range []struct {
123 process int
124 want string
125 }{
126 {process: 26231, want: "/usr/bin/vim"},
127 {process: 26232, want: ""},
128 } {
129 p, err := getProcFixtures(t).Proc(tt.process)
130 if err != nil {
131 t.Fatal(err)
132 }
133 exe, err := p.Executable()
134 if err != nil {
135 t.Fatal(err)
136 }
137 if diff := cmp.Diff(tt.want, exe); diff != "" {
138 t.Fatalf("unexpected absolute path to exe (-want +got):\n%s", diff)
139 }
140 }
141}
142
143func TestCwd(t *testing.T) {
144 for _, tt := range []struct {

Callers

nothing calls this directly

Calls 3

getProcFixturesFunction · 0.85
ProcMethod · 0.80
ExecutableMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…