mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-25 17:21:57 -07:00
search: fix -F and -f interaction bug
This fixes what appears to be a pretty egregious regression where the `-F/--fixed-strings` flag wasn't be applied to patterns supplied via the `-f/--file` flag. The same bug existed for the `-x/--line-regexp` flag as well, which we fix here. Fixes #1176
This commit is contained in:
@@ -672,3 +672,25 @@ rgtest!(r1174, |dir: Dir, mut cmd: TestCommand| {
|
||||
dir.create("a/foo", "test");
|
||||
cmd.arg("test").assert_err();
|
||||
});
|
||||
|
||||
// See: https://github.com/BurntSushi/ripgrep/issues/1176
|
||||
rgtest!(r1176_literal_file, |dir: Dir, mut cmd: TestCommand| {
|
||||
dir.create("patterns", "foo(bar\n");
|
||||
dir.create("test", "foo(bar");
|
||||
|
||||
eqnice!(
|
||||
"foo(bar\n",
|
||||
cmd.arg("-F").arg("-f").arg("patterns").arg("test").stdout()
|
||||
);
|
||||
});
|
||||
|
||||
// See: https://github.com/BurntSushi/ripgrep/issues/1176
|
||||
rgtest!(r1176_line_regex, |dir: Dir, mut cmd: TestCommand| {
|
||||
dir.create("patterns", "foo\n");
|
||||
dir.create("test", "foobar\nfoo\nbarfoo\n");
|
||||
|
||||
eqnice!(
|
||||
"foo\n",
|
||||
cmd.arg("-x").arg("-f").arg("patterns").arg("test").stdout()
|
||||
);
|
||||
});
|
||||
|
Reference in New Issue
Block a user