1 // Copyright 2021 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 "golang.org/x/tools/internal/lsp/command/gen"
13 "golang.org/x/tools/internal/testenv"
16 func TestGenerated(t *testing.T) {
17 testenv.NeedsGoBuild(t) // This is a lie. We actually need the source code.
19 onDisk, err := ioutil.ReadFile("command_gen.go")
24 generated, err := gen.Generate()
28 if !bytes.Equal(onDisk, generated) {
29 t.Error("command_gen.go is stale -- regenerate")