Unreviewed changes
3 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: gopls/internal/cmd/help_test.go
Insertions: 13, Deletions: 14.
@@ -98,32 +98,32 @@
}{
// gopls help
{
- []string{"help"},
- true,
- []string{
+ args: []string{"help"},
+ wantSuccess: true,
+ wantPatterns: []string{
"gopls is a Go language server",
"https://go.dev/gopls/features",
"Usage:",
"Command:",
- " links list links in a file", // command menu
+ " links.*list links in a file", // command menu
},
},
// gopls help remote
{
- []string{"help", "remote"},
- true,
- []string{
+ args: []string{"help", "remote"},
+ wantSuccess: true,
+ wantPatterns: []string{
"interact with the gopls daemon",
"Usage:",
"Subcommand:",
- " sessions print information about current gopls sessions", // subcommand menu
+ " sessions.*print information about current gopls sessions", // subcommand menu
},
},
// gopls help remote sessions
{
- []string{"help", "remote", "sessions"},
- true,
- []string{
+ args: []string{"help", "remote", "sessions"},
+ wantSuccess: true,
+ wantPatterns: []string{
"print information about current gopls sessions",
"Usage:",
"list sessions for the default daemon",
@@ -131,9 +131,8 @@
},
// gopls help remote nonesuch
{
- []string{"help", "remote", "nonesuch"},
- false,
- []string{
+ args: []string{"help", "remote", "nonesuch"},
+ wantPatterns: []string{
"gopls: no such subcommand: remote nonesuch",
},
},
```
Change information
Commit message:
gopls/internal/cmd: add tests of 'gopls help'
This CL turns tests that call tool.Run (which includes
only a part of the initialization process and is not
a reliable simulation of the gopls executable)
into true CLI integration tests.
These missing tests would have caught regressions in recent work
that was rolled back before the release. (See CL 793600.)
Also, use correct URL in help message.
For golang/go#80133
Change-Id: I985b48e7b44d74e4d481172a2cbe5e9b5804984b
Files:
- M gopls/internal/cmd/cmd.go
- M gopls/internal/cmd/help_test.go
- M gopls/internal/cmd/usage/usage-v.hlp
- M gopls/internal/cmd/usage/usage.hlp
Change size: M
Delta: 4 files changed, 90 insertions(+), 31 deletions(-)
Branch: refs/heads/master