mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-03 18:43:38 +01:00
Use native tempN_input subfeatures in both Linux temperature parsers. Keep real CPU, core, GPU, NVMe and additional readings and fan RPM intact, with complete-report and unit-spoofing regressions. Refs #3570. Product intelligence retains reproduced-fix, published-stable and issue-disposition follow-through; this source change does not close it before release. Change-source: pulse-maintainer
17 lines
662 B
Go
17 lines
662 B
Go
package sensors
|
||
|
||
import "testing"
|
||
|
||
func TestIsTemperatureInput(t *testing.T) {
|
||
for _, key := range []string{"temp1_input", "temp12_input", "temp999_input"} {
|
||
if !IsTemperatureInput(key) {
|
||
t.Errorf("temperature key %q rejected", key)
|
||
}
|
||
}
|
||
for _, key := range []string{"", "fan1_input", "in1_input", "curr1_input", "power1_input", "freq1_input", "energy1_input", "humidity1_input", "temp1_max", "temp1_crit", "temp1_label", "temp_input", "temperature_input", "temp-1_input", "temp1_input", "Temp1_input", "temp1_input_extra", "prefix_temp1_input"} {
|
||
if IsTemperatureInput(key) {
|
||
t.Errorf("non-temperature key %q admitted as Celsius", key)
|
||
}
|
||
}
|
||
}
|