100-days-of-rust/Week-08/Day-56_Convert-To-Hex/day56/tests/examples.rs

28 lines
621 B
Rust

/*
toHex("hello world") ➞ "68 65 6c 6c 6f 20 77 6f 72 6c 64"
toHex("Big Boi") ➞ "42 69 67 20 42 6f 69"
toHex("Marty Poppinson") ➞ "4d 61 72 74 79 20 50 6f 70 70 69 6e 73 6f 6e"
*/
#[cfg(test)]
mod examples {
use day56::to_hex;
#[test]
fn test_1() {
assert_eq!(to_hex("hello world"), "68 65 6c 6c 6f 20 77 6f 72 6c 64");
}
#[test]
fn test_2() {
assert_eq!(to_hex("Big Boi"), "42 69 67 20 42 6f 69");
}
#[test]
fn test_3() {
assert_eq!(
to_hex("Marty Poppinson"),
"4d 61 72 74 79 20 50 6f 70 70 69 6e 73 6f 6e"
);
}
}