From fd79228199ebad8919b16d18d853650b8552227e Mon Sep 17 00:00:00 2001 From: Daniel Tomlinson Date: Mon, 23 Nov 2020 11:15:00 +0000 Subject: [PATCH] Adding tests to test mod --- src/hands.rs | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/hands.rs b/src/hands.rs index f03a88d..1b4b51e 100644 --- a/src/hands.rs +++ b/src/hands.rs @@ -8,20 +8,24 @@ pub fn handify(input: &str) -> String { input } -#[test] -fn handify_test_no_trailing_spaces() { - let input = "hello world"; - assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏"); -} +#[cfg(test)] +mod test { + use super::*; + #[test] + fn handify_test_no_trailing_spaces() { + let input = "hello world"; + assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏"); + } -#[test] -fn handify_test_with_trailing_spaces() { - let input = " hello world "; - assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏") -} + #[test] + fn handify_test_with_trailing_spaces() { + let input = " hello world "; + assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏") + } -#[test] -fn handify_test_empty_string() { - let input = ""; - assert_eq!(handify(input), ""); + #[test] + fn handify_test_empty_string() { + let input = ""; + assert_eq!(handify(input), ""); + } }