aboutsummaryrefslogtreecommitdiff
path: root/helix-term/tests/integration/movement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/tests/integration/movement.rs')
-rw-r--r--helix-term/tests/integration/movement.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/helix-term/tests/integration/movement.rs b/helix-term/tests/integration/movement.rs
index cac10852..e0bfc3bf 100644
--- a/helix-term/tests/integration/movement.rs
+++ b/helix-term/tests/integration/movement.rs
@@ -109,8 +109,8 @@ async fn insert_to_normal_mode_cursor_position() -> anyhow::Result<()> {
/// the first grapheme
#[tokio::test]
async fn cursor_position_newly_opened_file() -> anyhow::Result<()> {
- let test = |content: &str, expected_sel: Selection| {
- let file = helpers::temp_file_with_contents(content);
+ let test = |content: &str, expected_sel: Selection| -> anyhow::Result<()> {
+ let file = helpers::temp_file_with_contents(content)?;
let mut app = Application::new(
Args {
@@ -118,17 +118,18 @@ async fn cursor_position_newly_opened_file() -> anyhow::Result<()> {
..Default::default()
},
Config::default(),
- )
- .unwrap();
+ )?;
let (view, doc) = helix_view::current!(app.editor);
let sel = doc.selection(view.id).clone();
assert_eq!(expected_sel, sel);
+
+ Ok(())
};
- test("foo", Selection::single(0, 1));
- test("๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ foo", Selection::single(0, 7));
- test("", Selection::single(0, 0));
+ test("foo", Selection::single(0, 1))?;
+ test("๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ foo", Selection::single(0, 7))?;
+ test("", Selection::single(0, 0))?;
Ok(())
}