mirror of
https://github.com/helix-editor/helix.git
synced 2024-12-23 00:11:54 +04:00
00653c772e
* Avoid cloning the whole paragraph content just for rendering * Fix tests
36 lines
1.2 KiB
Rust
36 lines
1.2 KiB
Rust
use helix_tui::{
|
|
backend::{Backend, TestBackend},
|
|
Terminal,
|
|
};
|
|
|
|
#[test]
|
|
fn terminal_buffer_size_should_not_be_limited() {
|
|
let backend = TestBackend::new(400, 400);
|
|
let terminal = Terminal::new(backend).unwrap();
|
|
let size = terminal.backend().size().unwrap();
|
|
assert_eq!(size.width, 400);
|
|
assert_eq!(size.height, 400);
|
|
}
|
|
|
|
// #[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| {
|
|
// let text = Text::from("Test");
|
|
// let paragraph = Paragraph::new(&text);
|
|
// f.render_widget(paragraph, f.size());
|
|
// })?;
|
|
// 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| {
|
|
// let text = Text::from("test");
|
|
// let paragraph = Paragraph::new(&text);
|
|
// f.render_widget(paragraph, f.size());
|
|
// })?;
|
|
// assert_eq!(frame.buffer.get(0, 0).symbol, "t");
|
|
// assert_eq!(frame.area, Rect::new(0, 0, 8, 8));
|
|
// Ok(())
|
|
// }
|