()
| 329 | |
| 330 | #[tokio::test] |
| 331 | async fn test_paging_interrupt() { |
| 332 | let mut cb = MockConsole::default(); |
| 333 | cb.set_size_chars(CharsXY { x: 60, y: 3 }); |
| 334 | cb.set_interactive(true); |
| 335 | cb.add_input_keys(&[Key::Escape]); |
| 336 | |
| 337 | let mut pager = Pager::new(&mut cb, None).unwrap(); |
| 338 | pager.print("line 1").await.unwrap(); |
| 339 | match pager.print("line 2").await { |
| 340 | Ok(()) => panic!("Should have been interrupted"), |
| 341 | Err(e) => assert_eq!(io::ErrorKind::Interrupted, e.kind()), |
| 342 | } |
| 343 | |
| 344 | assert_eq!( |
| 345 | [ |
| 346 | CapturedOut::Print("line 1".to_owned()), |
| 347 | CapturedOut::Print("line 2".to_owned()), |
| 348 | CapturedOut::Print(MORE_MESSAGE_WIDE.to_owned()), |
| 349 | ], |
| 350 | cb.captured_out() |
| 351 | ); |
| 352 | } |
| 353 | } |
nothing calls this directly
no test coverage detected