()
| 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() { |
nothing calls this directly
no test coverage detected