Skip to content

Commit fd91788

Browse files
committed
Add cat demonstration program
Signed-off-by: Leni Aniva <v@leni.sh>
1 parent dd33850 commit fd91788

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: examples/cat.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use rexpect::error::Error;
2+
use rexpect::spawn;
3+
4+
fn main() -> Result<(), Error> {
5+
let mut p = spawn("cat", Some(1000))?;
6+
7+
let ex: String = "∀".to_string();
8+
p.send_line(&ex)?;
9+
let line = p.read_line()?;
10+
11+
println!("In: {}", &ex);
12+
println!("Out: {}", &line);
13+
Ok(())
14+
}

0 commit comments

Comments
 (0)