Fix a test flake involving zeroed out group_intervals (#20328)

Release Notes:

- N/A
This commit is contained in:
Will Bradley 2024-11-07 09:17:43 -07:00 committed by GitHub
parent 454c9dc06d
commit de70852497
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 7 deletions

View file

@ -6482,11 +6482,21 @@ mod tests {
fn test_history(cx: &mut AppContext) {
let test_settings = SettingsStore::test(cx);
cx.set_global(test_settings);
let buffer_1 = cx.new_model(|cx| Buffer::local("1234", cx));
let buffer_2 = cx.new_model(|cx| Buffer::local("5678", cx));
let group_interval: Duration = Duration::from_millis(1);
let buffer_1 = cx.new_model(|cx| {
let mut buf = Buffer::local("1234", cx);
buf.set_group_interval(group_interval);
buf
});
let buffer_2 = cx.new_model(|cx| {
let mut buf = Buffer::local("5678", cx);
buf.set_group_interval(group_interval);
buf
});
let multibuffer = cx.new_model(|_| MultiBuffer::new(Capability::ReadWrite));
let group_interval = multibuffer.read(cx).history.group_interval;
multibuffer.update(cx, |this, _| {
this.history.group_interval = group_interval;
});
multibuffer.update(cx, |multibuffer, cx| {
multibuffer.push_excerpts(
buffer_1.clone(),