MCPcopy Create free account
hub / github.com/douchuan/algorithm / palindrome

Function palindrome

tests/test_strings.rs:362–369  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

360
361#[test]
362fn palindrome() {
363 assert!(palindrome::is_palindrome(""));
364 assert!(palindrome::is_palindrome("a"));
365 assert!(palindrome::is_palindrome("aba"));
366 assert!(palindrome::is_palindrome("abba"));
367 assert!(!palindrome::is_palindrome("abc"));
368 assert!(!palindrome::is_palindrome("abab"));
369}
370
371fn extract_words(i: &str) -> Vec<&str> {
372 i.split_whitespace().collect()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected