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

Function TestNetDevParseLine

net_dev_test.go:21–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestNetDevParseLine(t *testing.T) {
22 tc := []string{"eth0", "eth0:1"}
23 for i := range tc {
24 rawLine := fmt.Sprintf(` %v: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16`, tc[i])
25 have, err := NetDev{}.parseLine(rawLine)
26 if err != nil {
27 t.Fatal(err)
28 }
29 want := NetDevLine{tc[i], 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}
30 if want != *have {
31 t.Errorf("want %v, have %v", want, have)
32 }
33 }
34
35}
36
37func TestNetDev(t *testing.T) {
38 fs, err := NewFS(procTestFixtures)

Callers

nothing calls this directly

Calls 1

parseLineMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…