Unreviewed changes
1 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: gopls/internal/test/integration/bench/completion_test.go
Insertions: 6, Deletions: 6.
@@ -39,8 +39,8 @@
// Run a completion to make sure the system is warm.
loc := env.RegexpSearch(options.file, options.locationRegexp)
- if loc.Range.Start != loc.Range.End {
- b.Errorf("Completion locationRegexp only allows for zero width ranges, so use an empty regex group: ()")
+ if !loc.Range.Empty() {
+ b.Errorf("Completion locationRegexp only allows for empty ranges, so use an empty regex group: ()")
}
completions := env.Completion(loc)
@@ -308,8 +308,8 @@
// Run a completion to make sure the system is warm.
loc := env.RegexpSearch(test.file, test.locationRegexp)
- if loc.Range.Start != loc.Range.End {
- b.Errorf("Completion locationRegexp only allows for zero width ranges, so use an empty regex group: ()")
+ if !loc.Range.Empty() {
+ b.Errorf("Completion locationRegexp only allows for empty ranges, so use an empty regex group: ()")
}
loc.Range.End = loc.Range.Start
completions := env.Completion(loc)
@@ -330,8 +330,8 @@
editPlaceholder()
}
loc := env.RegexpSearch(test.file, test.locationRegexp)
- if loc.Range.Start != loc.Range.End {
- b.Errorf("Completion locationRegexp only allows for zero width ranges, so use an empty regex group: ()")
+ if !loc.Range.Empty() {
+ b.Errorf("Completion locationRegexp only allows for empty ranges, so use an empty regex group: ()")
}
env.Completion(loc)
}
```
Change information
Commit message:
gopls/internal/test: Completion benchmarks use empty range
CL 728881 enforced that gopls completions that pass a `Range` in the
TextDocumentPositionParams only do so with an empty range (start = end).
The benchmark tests weren't enforcing that, so many have been failing.
I fixed the failing tests and added a better error message to the test
code that encourages the regex string to only contain an empty group:
`()`.
Updates golang/go#80113
Change-Id: I1bdb82b4618e6c3eb04506eed93d81166a6a6964
Files:
- M gopls/internal/test/integration/bench/completion_test.go
Change size: S
Delta: 1 file changed, 15 insertions(+), 5 deletions(-)
Branch: refs/heads/master