(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func TestMemInfo(t *testing.T) { |
| 9 | file, err := os.Open("fixtures/proc/meminfo") |
| 10 | if err != nil { |
| 11 | t.Fatal(err) |
| 12 | } |
| 13 | defer file.Close() |
| 14 | |
| 15 | memInfo, err := parseMemInfo(file) |
| 16 | if err != nil { |
| 17 | t.Fatal(err) |
| 18 | } |
| 19 | |
| 20 | if want, got := 3831959552.0, memInfo["MemTotal_bytes"]; want != got { |
| 21 | t.Errorf("want memory total %f, got %f", want, got) |
| 22 | } |
| 23 | |
| 24 | if want, got := 3787456512.0, memInfo["DirectMap2M_bytes"]; want != got { |
| 25 | t.Errorf("want memory directMap2M %f, got %f", want, got) |
| 26 | } |
| 27 | } |
nothing calls this directly
no test coverage detected