add test for sensor_name and sensor_unit
All checks were successful
Unit Tests / Run Tests (push) Successful in 10s

This commit is contained in:
Travis Shears 2026-03-24 11:48:46 +01:00
parent 4b766f54ae
commit 113384b6ce
Signed by: travisshears
GPG key ID: CB9BF1910F3F7469
2 changed files with 25 additions and 2 deletions

19
test/sensors_test.gleam Normal file
View file

@ -0,0 +1,19 @@
import gleeunit
import gleeunit/should
import sensors
pub fn main() -> Nil {
gleeunit.main()
}
// gleeunit test functions end in `_test`
pub fn file_read_test() {
let reading =
sensors.sensor_name(sensors.Temperature)
<> " "
<> "20.5"
<> " "
<> sensors.sensor_unit(sensors.Temperature)
reading
|> should.equal("Temperature 20.5 °C")
}