[tests] Refine the test naming and error messages

- Make the naming of test cases less ambiguous, e.g., rename
  "missing_input_file" to "missing_input_arg" or "input_file_not_found"
- Unify the error messages on input/output options
This commit is contained in:
Ming-Hung Tsai
2021-06-23 17:42:41 +08:00
parent d00388f68a
commit 6660fde3c4
7 changed files with 49 additions and 28 deletions

View File

@@ -40,16 +40,16 @@ fn accepts_help() -> Result<()> {
}
#[test]
fn missing_metadata() -> Result<()> {
fn missing_input_arg() -> Result<()> {
let stderr = run_fail(cache_check!())?;
assert!(stderr.contains(msg::MISSING_INPUT_ARG));
Ok(())
}
#[test]
fn no_such_metadata() -> Result<()> {
fn input_file_not_found() -> Result<()> {
let stderr = run_fail(cache_check!("/arbitrary/filename"))?;
assert!(stderr.contains("No such file or directory"));
assert!(stderr.contains(msg::FILE_NOT_FOUND));
Ok(())
}