Adding tests to test mod

This commit is contained in:
Daniel Tomlinson
2020-11-23 11:15:00 +00:00
parent e9f7188c1c
commit fd79228199

View File

@@ -8,20 +8,24 @@ pub fn handify(input: &str) -> String {
input
}
#[test]
fn handify_test_no_trailing_spaces() {
#[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() {
#[test]
fn handify_test_with_trailing_spaces() {
let input = " hello world ";
assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏")
}
}
#[test]
fn handify_test_empty_string() {
#[test]
fn handify_test_empty_string() {
let input = "";
assert_eq!(handify(input), "");
}
}