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

Function test_split_last_line

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

Source from the content-addressed store, hash-verified

886
887 #[test]
888 fn test_split_last_line() {
889 let mut cb = MockConsole::default();
890 cb.set_size_chars(yx(10, 40));
891 let mut ob = OutputBuilder::new(yx(10, 40));
892 ob = ob.refresh(linecol(0, 0), &[""], yx(0, 0));
893
894 cb.add_input_chars(" abcd");
895 ob = ob.set_dirty();
896 ob = ob.add(CapturedOut::Write(" ".to_string()));
897 ob = ob.quick_refresh(linecol(0, 1), yx(0, 1));
898 ob = ob.add(CapturedOut::Write(" ".to_string()));
899 ob = ob.quick_refresh(linecol(0, 2), yx(0, 2));
900 ob = ob.add(CapturedOut::Write("a".to_string()));
901 ob = ob.quick_refresh(linecol(0, 3), yx(0, 3));
902 ob = ob.add(CapturedOut::Write("b".to_string()));
903 ob = ob.quick_refresh(linecol(0, 4), yx(0, 4));
904 ob = ob.add(CapturedOut::Write("c".to_string()));
905 ob = ob.quick_refresh(linecol(0, 5), yx(0, 5));
906 ob = ob.add(CapturedOut::Write("d".to_string()));
907 ob = ob.quick_refresh(linecol(0, 6), yx(0, 6));
908
909 cb.add_input_keys(&[Key::ArrowLeft]);
910 ob = ob.quick_refresh(linecol(0, 5), yx(0, 5));
911 cb.add_input_keys(&[Key::ArrowLeft]);
912 ob = ob.quick_refresh(linecol(0, 4), yx(0, 4));
913
914 cb.add_input_keys(&[Key::NewLine]);
915 ob = ob.refresh(linecol(1, 2), &[" ab", " cd"], yx(1, 2));
916
917 run_editor("", " ab\n cd\n", cb, ob);
918 }
919
920 #[test]
921 fn test_move_in_empty_file() {

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected