Skip to content

Commit

Permalink
Add stdin close integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
triarius committed Sep 2, 2024
1 parent 9a9ea6a commit d576522
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
use assert_cmd::Command;

#[test]
fn child_exit() {
use assert_cmd::Command;

let mut cmd = Command::cargo_bin("runner").unwrap();
let assert = cmd.args(["--", "echo", "hello"]).assert();
let mut runner = Command::cargo_bin("runner").unwrap();
let assert = runner.args(["--", "echo", "hello"]).assert();
assert.success().stdout("hello\n");
}

#[test]
fn stdin_close() {
let mut runner = Command::cargo_bin("runner").unwrap();
let assert = runner.args(["--", "cat"]).write_stdin("hello").assert();
assert.success().stdout("hello");
}

0 comments on commit d576522

Please sign in to comment.