2021-05-09 10:52:55 +02:00
|
|
|
use helix_tui::{
|
|
|
|
backend::{Backend, TestBackend},
|
|
|
|
Terminal,
|
|
|
|
};
|
|
|
|
|
|
|
|
#[test]
|
2022-10-26 05:00:13 +02:00
|
|
|
fn terminal_buffer_size_should_not_be_limited() {
|
2021-05-09 10:52:55 +02:00
|
|
|
let backend = TestBackend::new(400, 400);
|
|
|
|
let terminal = Terminal::new(backend).unwrap();
|
|
|
|
let size = terminal.backend().size().unwrap();
|
2022-10-26 05:00:13 +02:00
|
|
|
assert_eq!(size.width, 400);
|
|
|
|
assert_eq!(size.height, 400);
|
2021-05-09 10:52:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// #[test]
|
|
|
|
// fn terminal_draw_returns_the_completed_frame() -> Result<(), Box<dyn Error>> {
|
|
|
|
// let backend = TestBackend::new(10, 10);
|
|
|
|
// let mut terminal = Terminal::new(backend)?;
|
|
|
|
// let frame = terminal.draw(|f| {
|
2024-02-27 18:24:05 +01:00
|
|
|
// let text = Text::from("Test");
|
|
|
|
// let paragraph = Paragraph::new(&text);
|
2022-04-27 21:21:20 +02:00
|
|
|
// f.render_widget(paragraph, f.size());
|
2021-05-09 10:52:55 +02:00
|
|
|
// })?;
|
|
|
|
// assert_eq!(frame.buffer.get(0, 0).symbol, "T");
|
|
|
|
// assert_eq!(frame.area, Rect::new(0, 0, 10, 10));
|
|
|
|
// terminal.backend_mut().resize(8, 8);
|
|
|
|
// let frame = terminal.draw(|f| {
|
2024-02-27 18:24:05 +01:00
|
|
|
// let text = Text::from("test");
|
|
|
|
// let paragraph = Paragraph::new(&text);
|
2022-04-27 21:21:20 +02:00
|
|
|
// f.render_widget(paragraph, f.size());
|
2021-05-09 10:52:55 +02:00
|
|
|
// })?;
|
|
|
|
// assert_eq!(frame.buffer.get(0, 0).symbol, "t");
|
|
|
|
// assert_eq!(frame.area, Rect::new(0, 0, 8, 8));
|
|
|
|
// Ok(())
|
|
|
|
// }
|