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

Function test_paging_build_long_line_slowly

std/src/console/pager.rs:283–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

281
282 #[tokio::test]
283 async fn test_paging_build_long_line_slowly() {
284 let mut cb = MockConsole::default();
285 cb.set_size_chars(CharsXY { x: 10, y: 3 });
286 cb.set_interactive(true);
287 cb.add_input_keys(&[Key::NewLine]);
288
289 let mut pager = Pager::new(&mut cb, None).unwrap();
290 pager.write("this line").unwrap();
291 pager.print("is long").await.unwrap();
292 pager.print("line 2").await.unwrap();
293
294 assert_eq!(
295 [
296 CapturedOut::Write("this line".to_owned()),
297 CapturedOut::Print("is long".to_owned()),
298 CapturedOut::Print(MORE_MESSAGE_NARROW.to_owned()),
299 CapturedOut::Print("line 2".to_owned()),
300 ],
301 cb.captured_out()
302 );
303 }
304
305 #[tokio::test]
306 async fn test_paging_preserves_color_for_message() {

Callers

nothing calls this directly

Calls 5

set_interactiveMethod · 0.80
add_input_keysMethod · 0.80
set_size_charsMethod · 0.45
writeMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected