File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
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
6
+
7
+ package regtest
8
+
9
+ import (
10
+ "fmt"
11
+ "testing"
12
+ )
13
+
14
+ func TestBadGOPATH (t * testing.T ) {
15
+ const missingImport = `
16
+ -- main.go --
17
+ package main
18
+
19
+ func _() {
20
+ fmt.Println("Hello World")
21
+ }
22
+ `
23
+ // Test the case given in
24
+ // https://github.com/fatih/vim-go/issues/2673#issuecomment-622307211.
25
+ runner .Run (t , missingImport , 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
+ }, WithEnv (fmt .Sprintf ("GOPATH=:/path/to/gopath" )))
32
+ }
You can’t perform that action at this time.
0 commit comments