From d33e18172c6180b67e645e22b11fe4c75799160c Mon Sep 17 00:00:00 2001 From: David Tibbetts Date: Thu, 19 Oct 2017 18:39:17 -0500 Subject: [PATCH] Adding integration test for -x/--exec --- tests/tests.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/tests.rs b/tests/tests.rs index 750d501..28270f3 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -530,3 +530,26 @@ fn test_symlink() { ), ); } + +/// Execute command (--exec) +#[test] +fn test_exec() { + let te = TestEnv::new(); + + // Test a simple echo before each result + te.assert_output( + &["--exec", "echo found", "foo"], + "found a.foo + found one/b.foo + found one/two/c.foo + found one/two/C.Foo2 + found one/two/three/d.foo + found one/two/three/directory_foo", + ); + + // Test executing 'diff' with the found result and itself. No expected output. + te.assert_output( + &["--exec", "diff {} {}", "a.foo"], + "", + ); +} \ No newline at end of file