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:
parent
73103df6d9
commit
a2e6aec7a4
@ -799,3 +799,26 @@ rgtest!(r1537, |dir: Dir, mut cmd: TestCommand| {
|
|||||||
let expected = "foo:abc;de,fg\n";
|
let expected = "foo:abc;de,fg\n";
|
||||||
eqnice!(expected, cmd.arg(";(.*,){1}").stdout());
|
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());
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user