From e621720e477483f327687e3a433db8e7c97e1d1c Mon Sep 17 00:00:00 2001 From: Austin Schaefer Date: Fri, 21 Aug 2026 15:38:52 +0200 Subject: [PATCH] Split has_content test into three cases per reviewer request Separate tests for empty/whitespace/non-blank input so a regression points at the exact case that broke instead of a single bundled test. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01XJJQb2DWZZwQ1yPiaAQQoY --- crates/feeds/src/lib.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/feeds/src/lib.rs b/crates/feeds/src/lib.rs index 96b0d8b..f354ee2 100644 --- a/crates/feeds/src/lib.rs +++ b/crates/feeds/src/lib.rs @@ -74,12 +74,22 @@ fn estimate_read_seconds(text: &str) -> u32 { mod tests { use super::*; - /// A blank or whitespace-only feed title should be treated the same as - /// a missing one, not surfaced as an empty string in the UI. + /// An empty feed title should be treated the same as a missing one. #[test] - fn has_content_rejects_blank_strings() { + fn has_content_rejects_empty_string() { assert!(!has_content("")); + } + + /// A whitespace-only feed title should be treated the same as a + /// missing one, not surfaced as a blank-looking name in the UI. + #[test] + fn has_content_rejects_whitespace_only_string() { assert!(!has_content(" \n\t")); + } + + /// A real title is accepted as-is. + #[test] + fn has_content_accepts_non_blank_string() { assert!(has_content("Rust Blog")); } }