diff options
author | Andrew Gallant <jamslam@gmail.com> | 2016-09-24 20:10:26 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2016-09-24 20:10:30 -0400 |
commit | b941c10b9005edbb520cdd38fdb94ace2969fb57 (patch) | |
tree | e9b28470ea55c5e53cc566c23da5ae90a3ffaeef /tests | |
parent | 872a1076586781b522c75792d544b9a4f4a7d082 (diff) |
Fix directory whitelisting.
There was a bug in the translation from a gitignore pattern to a standard
glob where `!/dir` wasn't being interpreted as an absolute path.
Fixes #67.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tests.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index 5d4c41a9..3f8c3aa8 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -663,6 +663,18 @@ clean!(regression_65, "xyz", ".", |wd: WorkDir, mut cmd: Command| { wd.assert_err(&mut cmd); }); +// See: https://github.com/BurntSushi/ripgrep/issues/67 +clean!(regression_67, "test", ".", |wd: WorkDir, mut cmd: Command| { + wd.create(".gitignore", "/*\n!/dir"); + wd.create_dir("dir"); + wd.create_dir("foo"); + wd.create("foo/bar", "test"); + wd.create("dir/bar", "test"); + + let lines: String = wd.stdout(&mut cmd); + assert_eq!(lines, "dir/bar:test\n"); +}); + // See: https://github.com/BurntSushi/ripgrep/issues/20 sherlock!(feature_20, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| { cmd.arg("--no-filename"); |