Fix a test flake involving zeroed out group_intervals (#20328)
Release Notes: - N/A
This commit is contained in:
@@ -608,6 +608,7 @@ fn test_history() {
|
||||
fn test_finalize_last_transaction() {
|
||||
let now = Instant::now();
|
||||
let mut buffer = Buffer::new(0, BufferId::new(1).unwrap(), "123456".into());
|
||||
buffer.history.group_interval = Duration::from_millis(1);
|
||||
|
||||
buffer.start_transaction_at(now);
|
||||
buffer.edit([(2..4, "cd")]);
|
||||
|
||||
@@ -227,7 +227,7 @@ impl History {
|
||||
if let Some(mut entry) = entries.next_back() {
|
||||
while let Some(prev_entry) = entries.next_back() {
|
||||
if !prev_entry.suppress_grouping
|
||||
&& entry.first_edit_at - prev_entry.last_edit_at <= self.group_interval
|
||||
&& entry.first_edit_at - prev_entry.last_edit_at < self.group_interval
|
||||
{
|
||||
entry = prev_entry;
|
||||
count += 1;
|
||||
|
||||
Reference in New Issue
Block a user