1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00

tests: add new regression test for fixed inner literal bug

This adds a new test case for a bug (#1537) that has already been fixed.
Or more precisely, a new bug with the same root cause.

Closes #1559
This commit is contained in:
Andrew Gallant 2020-04-23 08:36:54 -04:00
parent 73103df6d9
commit a2e6aec7a4
No known key found for this signature in database
GPG Key ID: B2E3A4923F8B0D44

View File

@ -799,3 +799,26 @@ rgtest!(r1537, |dir: Dir, mut cmd: TestCommand| {
let expected = "foo:abc;de,fg\n";
eqnice!(expected, cmd.arg(";(.*,){1}").stdout());
});
// See: https://github.com/BurntSushi/ripgrep/issues/1559
rgtest!(r1559, |dir: Dir, mut cmd: TestCommand| {
dir.create(
"foo",
"\
type A struct {
TaskID int `json:\"taskID\"`
}
type B struct {
ObjectID string `json:\"objectID\"`
TaskID int `json:\"taskID\"`
}
",
);
let expected = "\
foo: TaskID int `json:\"taskID\"`
foo: TaskID int `json:\"taskID\"`
";
eqnice!(expected, cmd.arg("TaskID +int").stdout());
});