From c3ab2b72debaabe51e8476876f4ce174b1cc9495 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Mon, 6 Jan 2025 21:04:01 -0500 Subject: [PATCH] wip: test coverage for extend to range --- src/ui/test.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ui/test.rs b/src/ui/test.rs index 1b1a618..4792dac 100644 --- a/src/ui/test.rs +++ b/src/ui/test.rs @@ -1087,6 +1087,21 @@ fn test_range_select_copy_capital_c() { assert_range_copy!(InputScript::default().ctrl('C')); } +#[test] +fn test_extend_to_range() { + let mut ws = new_workspace(); + ws.book.edit_current_cell("=B1+1").expect("Failed to edit cell"); + ws.book.evaluate(); + InputScript::default() + .char('v') + .char('j') + .char('x') + .run(&mut ws) + .expect("Unable to run script"); + let extended_cell = ws.book.get_cell_addr_contents(&Address { row: 2, col: 1 }) + .expect("Failed to get cell contents"); + assert_eq!("=B2+1".to_string(), extended_cell); +} fn new_workspace<'a>() -> Workspace<'a> { Workspace::new_empty("en", "America/New_York").expect("Failed to get empty workbook")