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

Function test_read_line_interactive_test_home_end

std/src/console/readline.rs:1140–1191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1138
1139 #[test]
1140 fn test_read_line_interactive_test_home_end() {
1141 ReadLineInteractiveTest::default()
1142 .set_previous("sample text")
1143 .add_output(CapturedOut::Write("sample text".to_string()))
1144 .add_output(CapturedOut::SyncNow)
1145 // -
1146 .add_key(Key::End)
1147 // -
1148 .add_key(Key::Home)
1149 .add_output(CapturedOut::MoveWithinLine(-11))
1150 // -
1151 .add_key(Key::Home)
1152 // -
1153 .add_key(Key::Char('>'))
1154 .add_output(CapturedOut::HideCursor)
1155 .add_output_bytes(">")
1156 .add_output(CapturedOut::Write("sample text".to_string()))
1157 .add_output(CapturedOut::MoveWithinLine(-11))
1158 .add_output(CapturedOut::ShowCursor)
1159 // -
1160 .add_key(Key::End)
1161 .add_output(CapturedOut::MoveWithinLine(11))
1162 // -
1163 .add_key(Key::Char('<'))
1164 .add_output_bytes("<")
1165 // -
1166 .add_key(Key::ArrowLeft)
1167 .add_output(CapturedOut::MoveWithinLine(-1))
1168 // -
1169 .add_key(Key::ArrowLeft)
1170 .add_output(CapturedOut::MoveWithinLine(-1))
1171 // -
1172 .add_key(Key::ArrowLeft)
1173 .add_output(CapturedOut::MoveWithinLine(-1))
1174 // -
1175 .add_key(Key::ArrowLeft)
1176 .add_output(CapturedOut::MoveWithinLine(-1))
1177 // -
1178 .add_key(Key::ArrowLeft)
1179 .add_output(CapturedOut::MoveWithinLine(-1))
1180 // -
1181 .add_key(Key::Backspace)
1182 .add_output(CapturedOut::HideCursor)
1183 .add_output(CapturedOut::MoveWithinLine(-1))
1184 .add_output(CapturedOut::Write("text<".to_string()))
1185 .add_output_bytes(" ")
1186 .add_output(CapturedOut::MoveWithinLine(-6))
1187 .add_output(CapturedOut::ShowCursor)
1188 // -
1189 .set_line(">sampletext<")
1190 .accept();
1191 }
1192
1193 #[test]
1194 fn test_read_line_interactive_horizontal_scrolling_while_appending() {

Callers

nothing calls this directly

Calls 6

acceptMethod · 0.80
set_lineMethod · 0.80
add_outputMethod · 0.80
add_output_bytesMethod · 0.80
add_keyMethod · 0.80
set_previousMethod · 0.80

Tested by

no test coverage detected