Add command parser test for polarity command #139

Merged
sb10q merged 1 commits from atse/thermostat:add-polarity-test into master 2024-10-14 12:46:13 +08:00
1 changed files with 9 additions and 0 deletions

View File

@ -694,6 +694,15 @@ mod test {
}));
}
#[test]
fn parse_pwm_polarity() {
let command = Command::parse(b"pwm 0 polarity reversed");
assert_eq!(command, Ok(Command::PwmPolarity {
channel: 0,
polarity: Polarity::Reversed,
}));
}
#[test]
fn parse_pwm_pid() {
let command = Command::parse(b"pwm 0 pid");