flagon-io/hello

public

Greets people from the command line. The sample repository for g1t.

Commit

Add a farewell

syntaqxcommitted Parentc2ef68dBrowse files
1 file+10−00/1 viewed
+10−0
55 format!("Hello, {name}!")
66 }
77
8+/// The farewell for `name`.
9+pub fn farewell(name: &str) -> String {
10+ format!("Goodbye {name}!")
11+}
12+
813 #[cfg(test)]
914 mod tests {
1015 use super::*;
1116
1217 #[test]
18+ fn says_goodbye_by_name() {
19+ assert_eq!(farewell("Ada"), "Goodbye, Ada!");
20+ }
21+
22+ #[test]
1323 fn greets_by_name() {
1424 assert_eq!(greeting("Ada"), "Hello, Ada!");
1525 }