Display buffers in order of their path in refactor multibuffers

Previously, they were non-deterministically ordered via a HashMap iterator.
This was causing integration tests to fail spuriously on PRs.
This commit is contained in:
Max Brunsfeld 2022-04-27 14:01:30 -07:00
parent 27e693d8f7
commit 3ad13bdd4f
2 changed files with 16 additions and 11 deletions

View file

@ -3832,14 +3832,14 @@ mod tests {
.unwrap()
});
code_action_editor.update(cx_b, |editor, cx| {
assert_eq!(editor.text(cx), "\nmod other;\nfn main() { let foo = 4; }");
assert_eq!(editor.text(cx), "mod other;\nfn main() { let foo = 4; }\n");
editor.undo(&Undo, cx);
assert_eq!(
editor.text(cx),
"pub fn foo() -> usize { 4 }\nmod other;\nfn main() { let foo = other::foo(); }"
"mod other;\nfn main() { let foo = other::foo(); }\npub fn foo() -> usize { 4 }"
);
editor.redo(&Redo, cx);
assert_eq!(editor.text(cx), "\nmod other;\nfn main() { let foo = 4; }");
assert_eq!(editor.text(cx), "mod other;\nfn main() { let foo = 4; }\n");
});
}
@ -4037,17 +4037,17 @@ mod tests {
rename_editor.update(cx_b, |editor, cx| {
assert_eq!(
editor.text(cx),
"const TWO: usize = one::THREE + one::THREE;\nconst THREE: usize = 1;"
"const THREE: usize = 1;\nconst TWO: usize = one::THREE + one::THREE;"
);
editor.undo(&Undo, cx);
assert_eq!(
editor.text(cx),
"const TWO: usize = one::ONE + one::ONE;\nconst ONE: usize = 1;"
"const ONE: usize = 1;\nconst TWO: usize = one::ONE + one::ONE;"
);
editor.redo(&Redo, cx);
assert_eq!(
editor.text(cx),
"const TWO: usize = one::THREE + one::THREE;\nconst THREE: usize = 1;"
"const THREE: usize = 1;\nconst TWO: usize = one::THREE + one::THREE;"
);
});