From 5cf56035007f291b1b8f457fa3bfc79fb367419a Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 8 Sep 2025 10:03:38 +0200 Subject: [PATCH] strftime: add regression test case --- src/format/strftime.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/format/strftime.rs b/src/format/strftime.rs index a4cfef87..5dc1180c 100644 --- a/src/format/strftime.rs +++ b/src/format/strftime.rs @@ -1199,4 +1199,18 @@ mod tests { "2014-05-07T12:34:56+0000%Q%.2f%%" ); } + + /// Regression test for https://github.com/chronotope/chrono/issues/1725 + #[test] + #[cfg(any(feature = "alloc", feature = "std"))] + fn test_finite() { + let mut i = 0; + for item in StrftimeItems::new("%2f") { + println!("{:?}", item); + i += 1; + if i > 10 { + panic!("infinite loop"); + } + } + } }