add test for sensor_name and sensor_unit
All checks were successful
Unit Tests / Run Tests (push) Successful in 10s
All checks were successful
Unit Tests / Run Tests (push) Successful in 10s
This commit is contained in:
parent
4b766f54ae
commit
113384b6ce
2 changed files with 25 additions and 2 deletions
19
test/sensors_test.gleam
Normal file
19
test/sensors_test.gleam
Normal 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")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue