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

Function test_insert_in_empty_file

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

Source from the content-addressed store, hash-verified

770
771 #[test]
772 fn test_insert_in_empty_file() {
773 let mut cb = MockConsole::default();
774 cb.set_size_chars(yx(10, 40));
775 let mut ob = OutputBuilder::new(yx(10, 40));
776 ob = ob.refresh(linecol(0, 0), &[""], yx(0, 0));
777
778 cb.add_input_chars("abcéà");
779 ob = ob.set_dirty();
780 ob = ob.add(CapturedOut::Write("a".to_string()));
781 ob = ob.quick_refresh(linecol(0, 1), yx(0, 1));
782 ob = ob.add(CapturedOut::Write("b".to_string()));
783 ob = ob.quick_refresh(linecol(0, 2), yx(0, 2));
784 ob = ob.add(CapturedOut::Write("c".to_string()));
785 ob = ob.quick_refresh(linecol(0, 3), yx(0, 3));
786 ob = ob.add(CapturedOut::Write("é".to_string()));
787 ob = ob.quick_refresh(linecol(0, 4), yx(0, 4));
788 ob = ob.add(CapturedOut::Write("à".to_string()));
789 ob = ob.quick_refresh(linecol(0, 5), yx(0, 5));
790
791 cb.add_input_keys(&[Key::NewLine]);
792 ob = ob.quick_refresh(linecol(1, 0), yx(1, 0));
793
794 cb.add_input_keys(&[Key::CarriageReturn]);
795 ob = ob.quick_refresh(linecol(2, 0), yx(2, 0));
796
797 cb.add_input_chars("2");
798 ob = ob.add(CapturedOut::Write("2".to_string()));
799 ob = ob.quick_refresh(linecol(2, 1), yx(2, 1));
800
801 run_editor("", "abcéà\n\n2\n", cb, ob);
802 }
803
804 #[test]
805 fn test_insert_before_previous_content() {

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