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

Function test_move_page_down_up

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

Source from the content-addressed store, hash-verified

1020
1021 #[test]
1022 fn test_move_page_down_up() {
1023 let mut cb = MockConsole::default();
1024 cb.set_size_chars(yx(10, 40));
1025 let mut ob = OutputBuilder::new(yx(10, 40));
1026 ob = ob.refresh(linecol(0, 0), &["1", "2", "3", "4", "5", "6", "7", "8", "9"], yx(0, 0));
1027
1028 cb.add_input_keys(&[Key::PageDown]);
1029 ob = ob.quick_refresh(linecol(8, 0), yx(8, 0));
1030
1031 cb.add_input_keys(&[Key::PageDown]);
1032 ob = ob.refresh(
1033 linecol(16, 0),
1034 &["9", "10", "11", "12", "13", "14", "15", "16", "17"],
1035 yx(8, 0),
1036 );
1037
1038 cb.add_input_keys(&[Key::PageDown]);
1039 ob = ob.refresh(
1040 linecol(19, 0),
1041 &["12", "13", "14", "15", "16", "17", "18", "19", "20"],
1042 yx(8, 0),
1043 );
1044
1045 cb.add_input_keys(&[Key::PageDown]);
1046 ob = ob.quick_refresh(linecol(19, 0), yx(8, 0));
1047
1048 cb.add_input_keys(&[Key::PageUp]);
1049 ob = ob.quick_refresh(linecol(11, 0), yx(0, 0));
1050
1051 cb.add_input_keys(&[Key::PageUp]);
1052 ob = ob.refresh(linecol(3, 0), &["4", "5", "6", "7", "8", "9", "10", "11", "12"], yx(0, 0));
1053
1054 cb.add_input_keys(&[Key::PageUp]);
1055 ob = ob.refresh(linecol(0, 0), &["1", "2", "3", "4", "5", "6", "7", "8", "9"], yx(0, 0));
1056
1057 cb.add_input_keys(&[Key::PageUp]);
1058 ob = ob.quick_refresh(linecol(0, 0), yx(0, 0));
1059
1060 run_editor(
1061 "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n",
1062 "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n",
1063 cb,
1064 ob,
1065 );
1066 }
1067
1068 #[test]
1069 fn test_tab_append() {

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected