From eafc42ce8e024a9188505ef355df5b32c63a0386 Mon Sep 17 00:00:00 2001 From: Diego Barrios Romero Date: Wed, 21 Nov 2018 09:06:10 +0100 Subject: Add tests for assert function --- src/conversion.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/conversion.rs') diff --git a/src/conversion.rs b/src/conversion.rs index a3d8203..5e7751c 100644 --- a/src/conversion.rs +++ b/src/conversion.rs @@ -73,6 +73,17 @@ mod tests { } } + #[test] + fn check_assert_matches() { + assert_invalid_input_data::<()>(Err(Error::InvalidInputData)); + } + + #[test] + #[should_panic] + fn check_assert_fails() { + assert_invalid_input_data::<()>(Ok(0)); + } + #[test] fn convert_threshold_12_bits() { assert_invalid_input_data::<()>(ic::Resolution12Bit::convert_threshold(2048)); -- cgit v1.2.3-54-g00ecf