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

Function test_move_preserves_insertion_column

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

Source from the content-addressed store, hash-verified

1273
1274 #[test]
1275 fn test_move_preserves_insertion_column() {
1276 let mut cb = MockConsole::default();
1277 cb.set_size_chars(yx(10, 40));
1278 let mut ob = OutputBuilder::new(yx(10, 40));
1279 ob = ob.refresh(linecol(0, 0), &["longer", "a", "longer", "b"], yx(0, 0));
1280
1281 cb.add_input_keys(&[Key::ArrowRight]);
1282 ob = ob.quick_refresh(linecol(0, 1), yx(0, 1));
1283
1284 cb.add_input_keys(&[Key::ArrowRight]);
1285 ob = ob.quick_refresh(linecol(0, 2), yx(0, 2));
1286
1287 cb.add_input_keys(&[Key::ArrowRight]);
1288 ob = ob.quick_refresh(linecol(0, 3), yx(0, 3));
1289
1290 cb.add_input_keys(&[Key::ArrowRight]);
1291 ob = ob.quick_refresh(linecol(0, 4), yx(0, 4));
1292
1293 cb.add_input_keys(&[Key::ArrowDown]);
1294 ob = ob.quick_refresh(linecol(1, 1), yx(1, 1));
1295
1296 cb.add_input_keys(&[Key::ArrowDown]);
1297 ob = ob.quick_refresh(linecol(2, 4), yx(2, 4));
1298
1299 cb.add_input_keys(&[Key::Char('X')]);
1300 ob = ob.set_dirty();
1301 ob = ob.refresh_line(linecol(2, 5), "longXer", yx(2, 5));
1302
1303 cb.add_input_keys(&[Key::ArrowDown]);
1304 ob = ob.quick_refresh(linecol(3, 1), yx(3, 1));
1305
1306 cb.add_input_keys(&[Key::Char('Z')]);
1307 ob = ob.add(CapturedOut::Write("Z".to_string()));
1308 ob = ob.quick_refresh(linecol(3, 2), yx(3, 2));
1309
1310 run_editor("longer\na\nlonger\nb\n", "longer\na\nlongXer\nbZ\n", cb, ob);
1311 }
1312
1313 #[test]
1314 fn test_move_down_preserves_insertion_column_with_horizontal_scrolling() {

Callers

nothing calls this directly

Calls 10

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
refresh_lineMethod · 0.80
addMethod · 0.80
set_size_charsMethod · 0.45

Tested by

no test coverage detected