wip: add test for cell deletion

This commit is contained in:
Jeremy Wall 2024-12-28 10:27:50 -05:00 committed by Jeremy Wall
parent c5cbc1e75c
commit 52d1909868

View File

@ -563,3 +563,34 @@ fn test_traditional_copy_paste_rendered() {
"3", "3",
); );
} }
#[test]
fn test_clear_cell() {
let mut ws =
Workspace::new_empty("en", "America/New_York").expect("Failed to get empty workbook");
ws.book.edit_current_cell("foo")
.expect("failed to edit cell");
ws.book.evaluate();
assert_eq!("foo", ws.book.get_current_cell_contents().expect("failed to get cell contents"));
InputScript::default()
.add_char('d')
.run(&mut ws)
.expect("Failed to run input script");
assert_eq!("", ws.book.get_current_cell_contents().expect("failed to get cell contents"));
}
#[test]
fn test_clear_cell_all() {
let mut ws =
Workspace::new_empty("en", "America/New_York").expect("Failed to get empty workbook");
ws.book.edit_current_cell("foo")
.expect("failed to edit cell");
ws.book.evaluate();
assert_eq!("foo", ws.book.get_current_cell_contents().expect("failed to get cell contents"));
InputScript::default()
.add_char('D')
.run(&mut ws)
.expect("Failed to run input script");
assert_eq!("", ws.book.get_current_cell_contents().expect("failed to get cell contents"));
}