gopls/internal/regtest: add test for bad embed rules

Updates golang/go#44342.

Change-Id: I8518874fb20ae0a95f6fb2b62033e70a7d057067
Reviewed-on: https://go-review.googlesource.com/c/tools/+/295415
Trust: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
diff --git a/gopls/internal/regtest/misc/embed_test.go b/gopls/internal/regtest/misc/embed_test.go
new file mode 100644
index 0000000..4b74fee
--- /dev/null
+++ b/gopls/internal/regtest/misc/embed_test.go
@@ -0,0 +1,31 @@
+// 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.Await(env.DiagnosticAtRegexpWithMessage("x.go", `NONEXISTENT`, "no matching files found"))
+	})
+}