tty_form/
test.rs

1//! A virtual testing device based on the vte/vt100 parser used in functional and documentation tests.
2
3use crate::device::InputDevice;
4
5pub struct VirtualInputDevice;
6
7impl InputDevice for VirtualInputDevice {
8    fn read(&mut self) -> crossterm::Result<crossterm::event::Event> {
9        Ok(crossterm::event::Event::Key(
10            crossterm::event::KeyEvent::new(
11                crossterm::event::KeyCode::Enter,
12                crossterm::event::KeyModifiers::NONE,
13            ),
14        ))
15    }
16}