.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools / gopls@v0.6.9 / internal / regtest / misc / embed_test.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools/gopls@v0.6.9/internal/regtest/misc/embed_test.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools/gopls@v0.6.9/internal/regtest/misc/embed_test.go
new file mode 100644 (file)
index 0000000..76d1225
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+package misc
+
+import (
+       "testing"
+
+       . "golang.org/x/tools/gopls/internal/regtest"
+       "golang.org/x/tools/internal/testenv"
+)
+
+func TestMissingPatternDiagnostic(t *testing.T) {
+       testenv.NeedsGo1Point(t, 16)
+       const files = `
+-- go.mod --
+module example.com
+-- x.go --
+package x
+
+import (
+       _ "embed"
+)
+
+//go:embed NONEXISTENT
+var foo string
+`
+       Run(t, files, func(t *testing.T, env *Env) {
+               env.OpenFile("x.go")
+               env.Await(env.DiagnosticAtRegexpWithMessage("x.go", `NONEXISTENT`, "no matching files found"))
+               env.RegexpReplace("x.go", `NONEXISTENT`, "x.go")
+               env.Await(EmptyDiagnostics("x.go"))
+       })
+}