1 // Copyright 2020 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/testenv"
15 func TestGenerate(t *testing.T) {
16 testenv.NeedsGoBuild(t) // This is a lie. We actually need the source code.
17 testenv.NeedsGoPackages(t)
19 got, err := ioutil.ReadFile("../api_json.go")
23 want, err := generate()
27 if !bytes.Equal(got, want) {
28 t.Error("api_json is out of sync. Run `go generate ./internal/lsp/source` from the root of tools.")