mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 03:38:03 +01:00
Add test for PTY input
This commit is contained in:
11
src/pty.rs
11
src/pty.rs
@@ -281,4 +281,15 @@ sys.stdout.write('bar');
|
|||||||
|
|
||||||
assert_eq!(output, vec!["bar"]);
|
assert_eq!(output, vec!["bar"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn spawn_echo_input() {
|
||||||
|
let mut pty = spawn(&["cat"], &HashMap::new()).await;
|
||||||
|
pty.write_all(b"foo").await.unwrap();
|
||||||
|
pty.write_all(b"bar").await.unwrap();
|
||||||
|
pty.kill();
|
||||||
|
let output = read_output(pty).await.join("");
|
||||||
|
|
||||||
|
assert_eq!(output, "foobar");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user