A Rust clone of a Perl word-splitting program.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
438 B

  1. use std::process::Command; // Run programs
  2. use assert_cmd::prelude::*; // Add methods on commands
  3. use predicates::prelude::*; // Used for writing assertions
  4. #[test]
  5. fn file_doesnt_exist() -> Result<(), Box<dyn std::error::Error>> {
  6. let mut cmd = Command::main_binary()?;
  7. cmd.arg("test/file/doesnt/exist");
  8. cmd.assert()
  9. .failure()
  10. .stderr(predicate::str::contains("No such file or directory"));
  11. Ok(())
  12. }