diff options
author | Skyler Hawthorne | 2022-04-26 00:25:16 +0000 |
---|---|---|
committer | Skyler Hawthorne | 2022-06-19 03:54:03 +0000 |
commit | 1533f489340fb63eee31c12122d6233cb5f6abaf (patch) | |
tree | 2b31c8ce7295ae45de55663a5fccbe551f9494a8 /helix-term/tests/integration/movement.rs | |
parent | 2fbf83363028179fe8d3908b5d9911d8595163b1 (diff) |
use Results in integration tests for more error context
Diffstat (limited to 'helix-term/tests/integration/movement.rs')
-rw-r--r-- | helix-term/tests/integration/movement.rs | 15 |
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(()) } |