From 156eb43edad1b7ab1ed32f8a35beef3fa656770c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gro=C3=9F?= Date: Mon, 28 May 2018 14:48:45 +0200 Subject: [PATCH] Added simple test case for command addresses, so no regression should happen. --- src/epd4in2/command.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/epd4in2/command.rs b/src/epd4in2/command.rs index c82d930..c81bd79 100644 --- a/src/epd4in2/command.rs +++ b/src/epd4in2/command.rs @@ -151,4 +151,19 @@ impl Command { pub fn addr(self) -> u8 { self as u8 } +} + + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn command_addr() { + assert_eq!(Command::POWER_SAVING.addr(), 0xE3); + + assert_eq!(Command::PANEL_SETTING.addr(), 0x00); + + assert_eq!(Command::DISPLAY_REFRESH.addr(), 0x12); + } } \ No newline at end of file