diff options
author | Andrew Gallant <jamslam@gmail.com> | 2020-04-23 08:36:54 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2020-04-23 08:37:04 -0400 |
commit | a2e6aec7a4d9382941932245e8854f0ae5703a5e (patch) | |
tree | 566a42d57df074f85d25914af91dcf3387f36b29 /tests | |
parent | 73103df6d982da1a0dc775e9b7a03f5bb8cfd7fb (diff) |
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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/regression.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/regression.rs b/tests/regression.rs index 6cdf8b99..1bfd4f0f 100644 --- a/tests/regression.rs +++ b/tests/regression.rs @@ -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()); +}); |