Unified · Split
| @@ -5,8 +5,10 @@ mod ask { · 4 unmodified lines | |||
| 5 | #[cfg(unix)] | 5 | #[cfg(unix)] |
| 6 | fn username_password() { | 6 | fn username_password() { |
| 7 | let mut cmd = Command::new(env!("CARGO")); | 7 | let mut cmd = Command::new(env!("CARGO")); |
| 8 | cmd.args(["run", "--example", "credentials"]); | 8 | cmd.args(["build", "--example", "credentials"]); |
| 9 | let mut p = expectrl::Session::spawn(cmd).unwrap(); | 9 | cmd.spawn().unwrap().wait().expect("example builds OK"); |
| 10 | |||
| 11 | let mut p = expectrl::spawn("../target/debug/examples/credentials").unwrap(); | ||
| 10 | p.expect("Username: ").unwrap(); | 12 | p.expect("Username: ").unwrap(); |
| 11 | p.send_line(" user with space ").unwrap(); | 13 | p.send_line(" user with space ").unwrap(); |
| 12 | p.expect("\" user with space\"").unwrap(); | 14 | p.expect("\" user with space\"").unwrap(); |