blob: 634be03d1a32867e2f6340a0a379bd59d25bfb47 [file] [log] [blame]
extern crate mod1;
pub fn greeter(name: &str) -> String {
format!("Hello, {name}!")
}
pub fn default_greeter() -> String {
greeter(&mod1::world())
}
#[cfg(test)]
mod test {
#[test]
fn test_greeter() {
assert_eq!(super::greeter("Bob"), "Hello, Bob!");
}
#[test]
fn test_default_greeter() {
assert_eq!(super::default_greeter(), "Hello, world!");
}
}