use assert_cmd::Command; #[test] fn should_separate_std_input() -> Result<(), Box> { let mut cmd = Command::cargo_bin("fip")?; let assert = cmd .arg("3") .write_stdin("this is the first line\nthis is the second line\n") .assert(); assert.success().stdout("first\nsecond\n"); Ok(()) } #[test] fn should_separate_std_input_special_separator() -> Result<(), Box> { let mut cmd = Command::cargo_bin("fip")?; let assert = cmd .arg("-s,") .arg("2") .write_stdin("1,2,foo,3\n,2,bar,\n") .assert(); assert.success().stdout("foo\nbar\n"); Ok(()) }