return None;
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn test_first_word() {
+ assert_eq!(first_word(""), "");
+ assert_eq!(first_word("one"), "one");
+ assert_eq!(first_word("one two"), "one");
+
+ assert_eq!(first_word(&String::from("one two")), "one");
+ }
+
+ #[test]
+ fn test_second_word() {
+ assert_eq!(second_word(""), None);
+ assert_eq!(second_word("one"), None);
+ assert_eq!(second_word("one two"), Some("two"));
+ assert_eq!(second_word("one two three"), Some("two"));
+
+ assert_eq!(second_word(&String::from("one two three")), Some("two"));
+ }
+}