From d3b051d28ea62c313fc72583d04f2a897e8d6f40 Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Sat, 22 Oct 2022 17:29:09 -0400 Subject: fix test::plain test::plain uses char indices when it should use byte indices --- helix-term/tests/test/helpers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'helix-term/tests/test/helpers.rs') diff --git a/helix-term/tests/test/helpers.rs b/helix-term/tests/test/helpers.rs index de81f758..77332fa5 100644 --- a/helix-term/tests/test/helpers.rs +++ b/helix-term/tests/test/helpers.rs @@ -65,7 +65,7 @@ pub async fn test_key_sequences( for (i, (in_keys, test_fn)) in inputs.into_iter().enumerate() { let (view, doc) = current_ref!(app.editor); - let state = test::plain(&doc.text().to_string(), doc.selection(view.id)); + let state = test::plain(doc.text().slice(..), doc.selection(view.id)); log::debug!("executing test with document state:\n\n-----\n\n{}", state); @@ -81,7 +81,7 @@ pub async fn test_key_sequences( if !app_exited { let (view, doc) = current_ref!(app.editor); - let state = test::plain(&doc.text().to_string(), doc.selection(view.id)); + let state = test::plain(doc.text().slice(..), doc.selection(view.id)); log::debug!( "finished running test with document state:\n\n-----\n\n{}", -- cgit v1.2.3-70-g09d2