Files
weave-scope/vendor/github.com/c9s/goprocinfo/linux/process_statm_test.go
2015-12-04 13:57:32 +00:00

32 lines
470 B
Go

package linux
import (
"reflect"
"testing"
)
func TestReadProcessStatm(t *testing.T) {
statm, err := ReadProcessStatm("proc/3323/statm")
if err != nil {
t.Fatal("process statm read fail", err)
}
expected := &ProcessStatm{
Size: 4053,
Resident: 522,
Share: 174,
Text: 174,
Lib: 0,
Data: 286,
Dirty: 0,
}
if !reflect.DeepEqual(statm, expected) {
t.Error("not equal to expected", expected)
}
t.Logf("%+v", statm)
}