Skip to content

Commit 5cf5603

Browse files
committed
strftime: add regression test case
1 parent a623170 commit 5cf5603

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/format/strftime.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,4 +1199,18 @@ mod tests {
11991199
"2014-05-07T12:34:56+0000%Q%.2f%%"
12001200
);
12011201
}
1202+
1203+
/// Regression test for https://github.com/chronotope/chrono/issues/1725
1204+
#[test]
1205+
#[cfg(any(feature = "alloc", feature = "std"))]
1206+
fn test_finite() {
1207+
let mut i = 0;
1208+
for item in StrftimeItems::new("%2f") {
1209+
println!("{:?}", item);
1210+
i += 1;
1211+
if i > 10 {
1212+
panic!("infinite loop");
1213+
}
1214+
}
1215+
}
12021216
}

0 commit comments

Comments
 (0)