Skip to content

Commit

Permalink
tests: add new regression test for fixed inner literal bug
Browse files Browse the repository at this point in the history
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
  • Loading branch information
BurntSushi committed Apr 23, 2020
1 parent 73103df commit a2e6aec
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});

0 comments on commit a2e6aec

Please sign in to comment.