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

Function TestFileDescriptorTargets

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

Source from the content-addressed store, hash-verified

212}
213
214func TestFileDescriptorTargets(t *testing.T) {
215 p1, err := getProcFixtures(t).Proc(26231)
216 if err != nil {
217 t.Fatal(err)
218 }
219 fds, err := p1.FileDescriptorTargets()
220 if err != nil {
221 t.Fatal(err)
222 }
223 sort.Strings(fds)
224 var want = []string{
225 "../../symlinktargets/abc",
226 "../../symlinktargets/def",
227 "../../symlinktargets/ghi",
228 "../../symlinktargets/uvw",
229 "../../symlinktargets/xyz",
230 }
231 if diff := cmp.Diff(want, fds); diff != "" {
232 t.Fatalf("unexpected fds (-want +got):\n%s", diff)
233 }
234}
235
236func TestFileDescriptorsLen(t *testing.T) {
237 p1, err := getProcFixtures(t).Proc(26231)

Callers

nothing calls this directly

Calls 4

getProcFixturesFunction · 0.85
ProcMethod · 0.80
FileDescriptorTargetsMethod · 0.80
StringsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…