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

Function test_insert_before_last_character

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

Source from the content-addressed store, hash-verified

826
827 #[test]
828 fn test_insert_before_last_character() {
829 let mut cb = MockConsole::default();
830 cb.set_size_chars(yx(10, 40));
831 let mut ob = OutputBuilder::new(yx(10, 40));
832 ob = ob.refresh(linecol(0, 0), &[""], yx(0, 0));
833
834 cb.add_input_chars("abc");
835 ob = ob.set_dirty();
836 ob = ob.add(CapturedOut::Write("a".to_string()));
837 ob = ob.quick_refresh(linecol(0, 1), yx(0, 1));
838 ob = ob.add(CapturedOut::Write("b".to_string()));
839 ob = ob.quick_refresh(linecol(0, 2), yx(0, 2));
840 ob = ob.add(CapturedOut::Write("c".to_string()));
841 ob = ob.quick_refresh(linecol(0, 3), yx(0, 3));
842
843 cb.add_input_keys(&[Key::ArrowLeft]);
844 ob = ob.quick_refresh(linecol(0, 2), yx(0, 2));
845
846 cb.add_input_chars("d");
847 ob = ob.refresh_line(linecol(0, 3), "abdc", yx(0, 3));
848
849 run_editor("", "abdc\n", cb, ob);
850 }
851
852 #[test]
853 fn test_insert_newline_in_middle() {

Callers

nothing calls this directly

Calls 11

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

Tested by

no test coverage detected