Adding tests to test mod
This commit is contained in:
20
src/hands.rs
20
src/hands.rs
@@ -8,20 +8,24 @@ pub fn handify(input: &str) -> String {
|
|||||||
input
|
input
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[cfg(test)]
|
||||||
fn handify_test_no_trailing_spaces() {
|
mod test {
|
||||||
|
use super::*;
|
||||||
|
#[test]
|
||||||
|
fn handify_test_no_trailing_spaces() {
|
||||||
let input = "hello world";
|
let input = "hello world";
|
||||||
assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏");
|
assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn handify_test_with_trailing_spaces() {
|
fn handify_test_with_trailing_spaces() {
|
||||||
let input = " hello world ";
|
let input = " hello world ";
|
||||||
assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏")
|
assert_eq!(handify(input), "👏 HELLO 👏 WORLD 👏")
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn handify_test_empty_string() {
|
fn handify_test_empty_string() {
|
||||||
let input = "";
|
let input = "";
|
||||||
assert_eq!(handify(input), "");
|
assert_eq!(handify(input), "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user