Adding tests to test mod
This commit is contained in:
32
src/hands.rs
32
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), "");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user