Merge pull request #643 from MarekSpodBiedry:issue-512
This commit is contained in:
commit
91138569fa
|
|
@ -541,7 +541,7 @@ pub fn parse_iso_datetime(s: &str, sys: DateSystem) -> Option<f64> {
|
|||
}
|
||||
|
||||
pub fn parse_sqref(s: Option<&str>) -> Vec<RangeRef> {
|
||||
s.unwrap_or("").split_whitespace().filter_map(RangeRef::parse).take(10_000).collect()
|
||||
s.unwrap_or("").split_whitespace().filter_map(RangeRef::parse).collect()
|
||||
}
|
||||
|
||||
fn cf_op(s: Option<&str>) -> CfOperator {
|
||||
|
|
@ -974,4 +974,12 @@ mod tests {
|
|||
assert_eq!(parse_iso_datetime("garbage", DateSystem::D1900), None);
|
||||
assert_eq!(parse_iso_datetime("2024-13-01", DateSystem::D1900), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sqref_keeps_more_than_ten_thousand_ranges() {
|
||||
let sq = (1..=12_000).map(|r| format!("A{r}")).collect::<Vec<_>>().join(" ");
|
||||
let ranges = parse_sqref(Some(&sq));
|
||||
assert_eq!(ranges.len(), 12_000);
|
||||
assert_eq!(ranges.last().copied(), RangeRef::parse("A12000"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue