diff --git a/tests/tests.rs b/tests/tests.rs index 5330f40..b1e8f83 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -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]