[release] test/gopls: fix completion middleware test
gopls v0.5.0 seems to change the completion result ranking, so
the test that checked a specific entry for the most plausible
result is broken. This CL made the test use a more specific
query (fmt.P<> instead of fmt.<>) so the test can pass with
gopls 0.4.x and 0.5.0.
Probably, it's better to just check whether the desirable entry
is in one of the top k results where k is a reasonablly small
but larger than 1. I don't know what's a good number yet.
Fixes golang/vscode-go#649
Change-Id: I805b2f1b2c4ae6dde19f6a931434b46fb0954510
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/255119
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
(cherry picked from commit 5879a3ed3912572c632e79fec571eb3c6f4809e7)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/255120
diff --git a/test/gopls/extension.test.ts b/test/gopls/extension.test.ts
index 2816e2e..25d82bf 100644
--- a/test/gopls/extension.test.ts
+++ b/test/gopls/extension.test.ts
@@ -189,7 +189,7 @@
await env.reset('gogetdocTestData');
const { uri } = await env.openDoc('test.go');
const testCases: [string, vscode.Position, string][] = [
- ['fmt.<>', new vscode.Position(19, 5), 'Formatter'],
+ ['fmt.P<>', new vscode.Position(19, 6), 'Print'],
];
for (const [name, position, wantFilterText] of testCases) {
let list: vscode.CompletionList<vscode.CompletionItem>;