Fix a test flake involving zeroed out group_intervals (#20328)
Release Notes: - N/A
This commit is contained in:
parent
454c9dc06d
commit
de70852497
4 changed files with 22 additions and 7 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue