Files
Pulse/internal/sensors/temperature_input_test.go
pulse-triage[bot] 66fa10fd1a Keep non-temperature sensor inputs out of Celsius readings
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
2026-10-30 14:18:25 +00:00

17 lines
662 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)
}
}
}