diff options
author | Andrew Gallant <jamslam@gmail.com> | 2016-10-31 19:53:25 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2016-10-31 19:54:38 -0400 |
commit | 16975797feb297ed0e8022117723c71cd6013f4f (patch) | |
tree | 0ed333eeab92e4c40b2130d9a46bc108c49903f6 /tests | |
parent | 6507a48f97a7d4a4b28b08899c413d5a87d8bd02 (diff) |
Fixes a matching bug in the glob override matcher.
This was probably a transcription error when moving the ignore matcher
code out of ripgrep core. Specifically, the override glob matcher should
not ignore directories if they don't match.
Fixes #206
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tests.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index 795c0996..65962c74 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -865,6 +865,16 @@ clean!(regression_184, "test", ".", |wd: WorkDir, mut cmd: Command| { assert_eq!(lines, "baz:test\n"); }); +// See: https://github.com/BurntSushi/ripgrep/issues/206 +clean!(regression_206, "test", ".", |wd: WorkDir, mut cmd: Command| { + wd.create_dir("foo"); + wd.create("foo/bar.txt", "test"); + cmd.arg("-g").arg("*.txt"); + + let lines: String = wd.stdout(&mut cmd); + assert_eq!(lines, format!("{}:test\n", path("foo/bar.txt"))); +}); + // See: https://github.com/BurntSushi/ripgrep/issues/20 sherlock!(feature_20_no_filename, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| { |