mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-17 17:35:16 +01:00
Adding integration test for -x/--exec
This commit is contained in:
parent
ddfa0873fb
commit
d33e18172c
1 changed files with 23 additions and 0 deletions
|
@ -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"],
|
||||
"",
|
||||
);
|
||||
}
|
Loading…
Reference in a new issue