diff options
author | Marc Tiehuis <marctiehuis@gmail.com> | 2017-03-04 21:40:19 +1300 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2017-03-08 10:13:28 -0500 |
commit | 066f97d85553f12696272086d26fa86fc2c84d9e (patch) | |
tree | b6701e9c3badf2ddac31fa4ef824913c5049b050 /tests | |
parent | df1bf4a042160e0b9b1a1d05de68f0ffcb6c66f0 (diff) |
Add enclosing group to alternations in globs
Fixes #391.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tests.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index 858fc623..aeacca54 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1326,6 +1326,27 @@ fn regression_270() { assert_eq!(lines, path("foo:-test\n")); } +// See: https://github.com/BurntSushi/ripgrep/issues/391 +#[test] +fn regression_391() { + let wd = WorkDir::new("regression_391"); + wd.create_dir(".git"); + wd.create("lock", ""); + wd.create("bar.py", ""); + wd.create(".git/packed-refs", ""); + wd.create(".git/description", ""); + + let mut cmd = wd.command(); + cmd.arg("--no-ignore").arg("--hidden").arg("--follow").arg("--files") + .arg("--glob") + .arg("!{.git,node_modules,plugged}/**") + .arg("--glob") + .arg("*.{js,json,php,md,styl,scss,sass,pug,html,config,py,cpp,c,go,hs}"); + + let lines: String = wd.stdout(&mut cmd); + assert_eq!(lines, "bar.py\n"); +} + #[test] fn type_list() { let wd = WorkDir::new("type_list"); |