package metrics import "testing" // a two-socket board: two coretemp chips, and the CPU's temperature is the hotter package func TestCPUTempHottestPackage(t *testing.T) { temps := []Temp{ {Chip: "coretemp", Label: "Core 0", C: 31}, {Chip: "coretemp", Label: "Core 0", C: 44, Pkg: 1}, {Chip: "coretemp", Label: "Package id 0", C: 35}, {Chip: "coretemp", Label: "Package id 1", C: 41, Pkg: 1}, } if got := cpuTemp(temps); got != 41 { t.Fatalf("cpuTemp = %v, want 41", got) } }