From 415392559937972343bf4a18908d894411d7805c Mon Sep 17 00:00:00 2001 From: SpatulaNinja Date: Fri, 20 Oct 2017 00:21:22 -0500 Subject: [PATCH] Added output status code to `format_exit_error` for debugging --- tests/testenv/mod.rs | 6 ++++-- tests/tests.rs | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/testenv/mod.rs b/tests/testenv/mod.rs index d1cca69..2adcb1e 100644 --- a/tests/testenv/mod.rs +++ b/tests/testenv/mod.rs @@ -77,10 +77,12 @@ fn find_fd_exe() -> PathBuf { /// Format an error message for when *fd* did not exit successfully. fn format_exit_error(args: &[&str], output: &process::Output) -> String { format!( - "`fd {}` did not exit successfully.\nstdout:\n---\n{}---\nstderr:\n---\n{}---", + "`fd {}` did not exit successfully.\nstdout:\n---\n{}---\nstderr:\n---\n{}---\n + code:\n---\n{:?}---\n", args.join(" "), String::from_utf8_lossy(&output.stdout), - String::from_utf8_lossy(&output.stderr) + String::from_utf8_lossy(&output.stderr), + output.status.code() ) } diff --git a/tests/tests.rs b/tests/tests.rs index 4f22b7b..672cae1 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -550,7 +550,7 @@ fn test_exec() { Comparing files a.foo and A.FOO FC: no differences encountered", ); - + // Test executing 'diff' with the found result and itself. - #[cfg(unix)] te.assert_output(&["--exec", "diff {} {}", "a.foo"],""); + #[cfg(unix)] te.assert_output(&["--exec", "diff {} {}", "a.foo"], ""); }