mirror of https://github.com/sharkdp/fd.git
Add unit tests for `--quote`
This commit is contained in:
parent
6cfdd45dc5
commit
9bf0306725
|
@ -76,6 +76,14 @@ fn test_simple() {
|
|||
);
|
||||
}
|
||||
|
||||
static AND_QUOTE_FILES: &[&str] = &[
|
||||
"one'two.quo",
|
||||
"one two.quo",
|
||||
"one\"two.quo",
|
||||
"one$two.quo",
|
||||
"one'two$.quo",
|
||||
];
|
||||
|
||||
static AND_EXTRA_FILES: &[&str] = &[
|
||||
"a.foo",
|
||||
"one/b.foo",
|
||||
|
@ -2527,6 +2535,20 @@ fn test_strip_cwd_prefix() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_quoting() {
|
||||
let te = TestEnv::new(DEFAULT_DIRS, AND_QUOTE_FILES);
|
||||
|
||||
te.assert_output(
|
||||
&["--quote", ".quo"],
|
||||
"'one two.quo'
|
||||
\"one'two.quo\"
|
||||
\"one'two\\$.quo\"
|
||||
'one\"two.quo'
|
||||
'one$two.quo'",
|
||||
);
|
||||
}
|
||||
|
||||
/// When fd is ran from a non-existent working directory, but an existent
|
||||
/// directory is passed in the arguments, it should still run fine
|
||||
#[test]
|
||||
|
|
Loading…
Reference in New Issue