| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
package workspace |
| 6 |
|
| 7 |
import ( |
| 8 |
"testing" |
| 9 |
|
| 10 |
. "golang.org/x/tools/gopls/internal/test/integration" |
| 11 |
) |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
func TestAdhoc_Edits(t *testing.T) { |
| 16 |
const files = ` |
| 17 |
-- a.go -- |
| 18 |
package foo |
| 19 |
|
| 20 |
const X = 1 |
| 21 |
|
| 22 |
-- b.go -- |
| 23 |
package foo |
| 24 |
|
| 25 |
// import "errors" |
| 26 |
|
| 27 |
const Y = X |
| 28 |
` |
| 29 |
|
| 30 |
Run(t, files, func(t *testing.T, env *Env) { |
| 31 |
env.OpenFile("b.go") |
| 32 |
|
| 33 |
for range 10 { |
| 34 |
env.RegexpReplace("b.go", `// import "errors"`, `import "errors"`) |
| 35 |
env.RegexpReplace("b.go", `import "errors"`, `// import "errors"`) |
| 36 |
env.AfterChange(NoDiagnostics()) |
| 37 |
} |
| 38 |
}) |
| 39 |
} |