diff --git a/Makefile b/Makefile index 2caacbdab..ad6009ec7 100644 --- a/Makefile +++ b/Makefile @@ -164,6 +164,7 @@ TEST_PROGS := \ dirname \ echo \ factor \ + false \ fold \ mkdir \ mv \ @@ -173,6 +174,7 @@ TEST_PROGS := \ sort \ test \ tr \ + true \ truncate \ unexpand diff --git a/test/false.rs b/test/false.rs new file mode 100644 index 000000000..2cd6a327d --- /dev/null +++ b/test/false.rs @@ -0,0 +1,9 @@ +use std::process::Command; + +static PROGNAME: &'static str = "./false"; + +#[test] +fn test_exit_code() { + let exit_status = Command::new(PROGNAME).status().unwrap().success(); + assert_eq!(exit_status, false); +} diff --git a/test/true.rs b/test/true.rs new file mode 100644 index 000000000..fba9fff36 --- /dev/null +++ b/test/true.rs @@ -0,0 +1,9 @@ +use std::process::Command; + +static PROGNAME: &'static str = "./true"; + +#[test] +fn test_exit_code() { + let exit_status = Command::new(PROGNAME).status().unwrap().success(); + assert_eq!(exit_status, true); +}