@@ -0,0 +1,24 @@
1+use helix_term::{application::Application, args::Args, config::Config};
2+use helix_view::current;
3+
4+use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers};
5+
6+#[tokio::test]
7+async fn it_works() {
8+ let args = Args::default();
9+ let config = Config::default();
10+ let mut app = Application::new(args, config).unwrap();
11+
12+ let inputs = &['i', 'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'];
13+
14+ for input in inputs {
15+ // TODO: use input.parse::<KeyEvent>
16+ app.handle_terminal_events(Ok(Event::Key(KeyEvent {
17+ code: KeyCode::Char(*input),
18+ modifiers: KeyModifiers::NONE,
19+ })));
20+ }
21+
22+ let (_, doc) = current!(app.editor);
23+ assert_eq!(doc.text(), "hello world\n");
24+}