MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_delete_last_character_of_line

Function test_delete_last_character_of_line

repl/src/editor.rs:1207–1226  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1205
1206 #[test]
1207 fn test_delete_last_character_of_line() {
1208 let mut cb = MockConsole::default();
1209 cb.set_size_chars(yx(10, 40));
1210 let mut ob = OutputBuilder::new(yx(10, 40));
1211 ob = ob.refresh(linecol(0, 0), &["sample"], yx(0, 0));
1212
1213 for i in 0..5u16 {
1214 cb.add_input_keys(&[Key::ArrowRight]);
1215 ob = ob.quick_refresh(linecol(0, usize::from(i + 1)), yx(0, i + 1));
1216 }
1217
1218 cb.add_input_keys(&[Key::Delete]);
1219 ob = ob.set_dirty();
1220 ob = ob.add(CapturedOut::HideCursor);
1221 ob = ob.add(CapturedOut::Clear(ClearType::UntilNewLine));
1222 ob = ob.add(CapturedOut::ShowCursor);
1223 ob = ob.quick_refresh(linecol(0, 5), yx(0, 5));
1224
1225 run_editor("sample\n", "sampl\n", cb, ob);
1226 }
1227
1228 fn do_delete_joins_with_next_line_test(key: Key) {
1229 let mut cb = MockConsole::default();

Callers

nothing calls this directly

Calls 9

yxFunction · 0.85
linecolFunction · 0.85
run_editorFunction · 0.85
refreshMethod · 0.80
add_input_keysMethod · 0.80
quick_refreshMethod · 0.80
set_dirtyMethod · 0.80
addMethod · 0.80
set_size_charsMethod · 0.45

Tested by

no test coverage detected