Fix editor tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
c52b6328b7
commit
1d487e19f9
1 changed files with 15 additions and 14 deletions
|
@ -729,21 +729,19 @@ fn test_fold_action(cx: &mut TestAppContext) {
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
fn test_move_cursor(cx: &mut TestAppContext) {
|
fn test_move_cursor(cx: &mut TestAppContext) {
|
||||||
cx.update(|cx| cx.set_global(Settings::test(cx)));
|
cx.update(|cx| cx.set_global(Settings::test(cx)));
|
||||||
let (_, view) = cx.add_window(|cx| {
|
let buffer = cx.update(|cx| MultiBuffer::build_simple(&sample_text(6, 6, 'a'), cx));
|
||||||
let buffer = MultiBuffer::build_simple(&sample_text(6, 6, 'a'), cx);
|
let (_, view) = cx.add_window(|cx| build_editor(buffer.clone(), cx));
|
||||||
buffer.update(cx, |buffer, cx| {
|
|
||||||
buffer.edit(
|
|
||||||
vec![
|
|
||||||
(Point::new(1, 0)..Point::new(1, 0), "\t"),
|
|
||||||
(Point::new(1, 1)..Point::new(1, 1), "\t"),
|
|
||||||
],
|
|
||||||
None,
|
|
||||||
cx,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
build_editor(buffer.clone(), cx)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
buffer.update(cx, |buffer, cx| {
|
||||||
|
buffer.edit(
|
||||||
|
vec![
|
||||||
|
(Point::new(1, 0)..Point::new(1, 0), "\t"),
|
||||||
|
(Point::new(1, 1)..Point::new(1, 1), "\t"),
|
||||||
|
],
|
||||||
|
None,
|
||||||
|
cx,
|
||||||
|
);
|
||||||
|
});
|
||||||
view.update(cx, |view, cx| {
|
view.update(cx, |view, cx| {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
view.selections.display_ranges(cx),
|
view.selections.display_ranges(cx),
|
||||||
|
@ -5848,6 +5846,7 @@ async fn go_to_hunk(deterministic: Arc<Deterministic>, cx: &mut gpui::TestAppCon
|
||||||
&r#"
|
&r#"
|
||||||
ˇuse some::modified;
|
ˇuse some::modified;
|
||||||
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("hello there");
|
println!("hello there");
|
||||||
|
|
||||||
|
@ -5869,6 +5868,7 @@ async fn go_to_hunk(deterministic: Arc<Deterministic>, cx: &mut gpui::TestAppCon
|
||||||
&r#"
|
&r#"
|
||||||
use some::modified;
|
use some::modified;
|
||||||
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
ˇ println!("hello there");
|
ˇ println!("hello there");
|
||||||
|
|
||||||
|
@ -5892,6 +5892,7 @@ async fn go_to_hunk(deterministic: Arc<Deterministic>, cx: &mut gpui::TestAppCon
|
||||||
&r#"
|
&r#"
|
||||||
ˇuse some::modified;
|
ˇuse some::modified;
|
||||||
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("hello there");
|
println!("hello there");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue