Skip to content

Commit

Permalink
add unit test for sensors.TemperaturesWithContext
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Oct 7, 2024
1 parent 45e3591 commit e731c60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sensors/sensors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
package sensors

import (
"context"
"fmt"
"testing"

"github.com/shirou/gopsutil/v4/sensors"
)

func TestTemperatureStat_String(t *testing.T) {
Expand All @@ -19,3 +22,8 @@ func TestTemperatureStat_String(t *testing.T) {
t.Errorf("TemperatureStat string is invalid, %v", fmt.Sprintf("%v", v))
}
}

func TestTemperatures(t *testing.T) {
// make sure it does not segfault
sensors.TemperaturesWithContext(context.TODO())
}

0 comments on commit e731c60

Please sign in to comment.