Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools / gopls@v0.5.2 / internal / regtest / unix_test.go
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.
4
5 // +build !windows,!plan9
6
7 package regtest
8
9 import (
10         "testing"
11 )
12
13 func TestBadGOPATH(t *testing.T) {
14         const files = `
15 -- main.go --
16 package main
17
18 func _() {
19         fmt.Println("Hello World")
20 }
21 `
22         // https://github.com/fatih/vim-go/issues/2673#issuecomment-622307211.
23         withOptions(
24                 EditorConfig{Env: map[string]string{"GOPATH": ":/path/to/gopath"}},
25         ).run(t, files, func(t *testing.T, env *Env) {
26                 env.OpenFile("main.go")
27                 env.Await(env.DiagnosticAtRegexp("main.go", "fmt"))
28                 if err := env.Editor.OrganizeImports(env.Ctx, "main.go"); err != nil {
29                         t.Fatal(err)
30                 }
31         })
32 }