From 2095e622d7e611493794800d50d3f8e548236ff7 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Mon, 22 Jun 2020 18:12:11 +0200 Subject: Add unit test --- src/types.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/types.rs b/src/types.rs index 5ceabc4..2b9fc02 100644 --- a/src/types.rs +++ b/src/types.rs @@ -259,8 +259,8 @@ pub struct Ads1x1x { #[cfg(test)] mod tests { - use crate::SlaveAddr; use crate::DEVICE_BASE_ADDRESS as ADDR; + use crate::{FullScaleRange, SlaveAddr}; #[test] fn can_get_default_address() { @@ -283,4 +283,9 @@ mod tests { assert_eq!(0b100_1010, SlaveAddr::new_sda().addr(ADDR)); assert_eq!(0b100_1011, SlaveAddr::new_scl().addr(ADDR)); } + + #[test] + fn default_full_scale_range() { + assert_eq!(FullScaleRange::Within2_048V, FullScaleRange::default()); + } } -- cgit v1.2.3-54-g00ecf