summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/regression.rs23
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());
+});