diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-03-12 15:51:26 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-03-12 15:51:26 -0500 |
commit | 1aa54fb6b45e8eea4604f8c8acaecb3bb9086fb4 (patch) | |
tree | 68a3d002da070d7dafbca7c2e73e6f307b1007c1 /tests/basic.rs | |
parent | eb3f6dbccfc2f1c87ec3c38c78abc3337ceb3ccb (diff) | |
download | textmode-1aa54fb6b45e8eea4604f8c8acaecb3bb9086fb4.tar.gz textmode-1aa54fb6b45e8eea4604f8c8acaecb3bb9086fb4.zip |
add another test
Diffstat (limited to 'tests/basic.rs')
-rw-r--r-- | tests/basic.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/basic.rs b/tests/basic.rs index 71ed857..3b52bc2 100644 --- a/tests/basic.rs +++ b/tests/basic.rs @@ -5,7 +5,26 @@ mod fixtures; #[test] fn test_basic() { - fixtures::run_fixture("basic", true, |pty| { + fixtures::run_fixture("basic", "", true, |pty| { + pty.write_all(b"a").unwrap(); + assert_eq!(fixtures::read(pty), b"\x1b[6;6Hfoo"); + + pty.write_all(b"a").unwrap(); + assert!(!fixtures::read_ready(pty.as_raw_fd())); + + pty.write_all(b"a").unwrap(); + assert_eq!( + fixtures::read(pty), + b"\x1b[9;9H\x1b[32mbar\x1b[12;12H\x1b[mbaz" + ); + + pty.write_all(b"a").unwrap(); + }); +} + +#[test] +fn test_async() { + fixtures::run_fixture("async", "async", true, |pty| { pty.write_all(b"a").unwrap(); assert_eq!(fixtures::read(pty), b"\x1b[6;6Hfoo"); |