mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-17 09:28:25 +01:00
Simplifying echo test and using #[cfg(plat)]
now
Windows and *nix specific exec tests now. Line endings for output of windows exec might still be a problem on AppVeyor/Travis.
This commit is contained in:
parent
d3831eecf3
commit
3a7fe6e140
1 changed files with 9 additions and 12 deletions
|
@ -536,22 +536,19 @@ fn test_symlink() {
|
||||||
fn test_exec() {
|
fn test_exec() {
|
||||||
let te = TestEnv::new();
|
let te = TestEnv::new();
|
||||||
|
|
||||||
// Test a simple echo before each result
|
// Test a simple echo before result
|
||||||
te.assert_output(
|
te.assert_output(&["--exec", "echo found", "d.foo"], "found one/two/three/d.foo");
|
||||||
&["--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",
|
|
||||||
);
|
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
// Test executing 'fc' (File Compare) with the found result and itself.
|
// Test executing 'fc' (File Compare) with the found result and itself.
|
||||||
te.assert_output(
|
te.assert_output(
|
||||||
&["--exec", "fc {} {}", "a.foo"],
|
&["--exec", "fc {} {}", "a.foo"],
|
||||||
"
|
"
|
||||||
Comparing files a.foo and A.FOO
|
Comparing files a.foo and A.FOO
|
||||||
FC: no differences encountered"
|
FC: no differences encountered",
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
#[cfg(unix)]
|
||||||
|
// Test executing 'diff' with the found result and itself.
|
||||||
|
te.assert_output(&["--exec", "diff {} {}", "a.foo"],"");
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue