summaryrefslogtreecommitdiffstats
path: root/devices/temp_darwin_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'devices/temp_darwin_test.go')
-rw-r--r--devices/temp_darwin_test.go45
1 files changed, 45 insertions, 0 deletions
diff --git a/devices/temp_darwin_test.go b/devices/temp_darwin_test.go
new file mode 100644
index 0000000..6222b57
--- /dev/null
+++ b/devices/temp_darwin_test.go
@@ -0,0 +1,45 @@
+// +build darwin
+
+package devices
+
+import (
+ "testing"
+)
+
+func Test_loadIDs(t *testing.T) {
+ tests := []struct {
+ key string
+ want string
+ }{
+ {"TCAD", "CPU 1 Package Alt."},
+ {"TC1P", "CPU 2 Proximity"},
+ {"TC1H", "CPU 2 Heatsink"},
+ {"TC1D", "CPU 2 Package"},
+ {"TC1E", "CPU 2"},
+ {"TC1F", "CPU 2"},
+ {"TCBH", "CPU 2 Heatsink Alt."},
+ {"TCBD", "CPU 2 Package Alt."},
+ {"TG0P", "GPU Proximity"},
+ {"TG1D", "GPU Die"},
+ {"TG0H", "GPU Heatsink"},
+ {"TG1H", "GPU Heatsink"},
+ {"Ts0S", "Memory Proximity"},
+ {"TM0P", "Mem Bank A1"},
+ {"TM9P", "Mem Bank B2"},
+ {"TCXC", "PECI CPU"},
+ {"PSTR", "System Total"},
+ }
+ ids := loadIDs()
+ L := 161
+ if len(ids) != L {
+ t.Errorf("len(loadIDs) = %d, want %d", len(ids), L)
+ }
+ for _, tt := range tests {
+ t.Run("contents", func(t *testing.T) {
+ got := ids[tt.key]
+ if got != tt.want {
+ t.Errorf("ids[%s] = %v, want %v", tt.key, got, tt.want)
+ }
+ })
+ }
+}