From 72aee5d283e29e17af5f46d668822994ace236fb Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 7 Oct 2024 09:49:08 +0800 Subject: [PATCH] Add command parser test for polarity command --- src/command_parser.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/command_parser.rs b/src/command_parser.rs index f8bfd72..5eb3589 100644 --- a/src/command_parser.rs +++ b/src/command_parser.rs @@ -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");