diff options
Diffstat (limited to 'gopls/internal/regtest/debug/debug_test.go')
-rw-r--r-- | gopls/internal/regtest/debug/debug_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gopls/internal/regtest/debug/debug_test.go b/gopls/internal/regtest/debug/debug_test.go new file mode 100644 index 000000000..f8efb8f5d --- /dev/null +++ b/gopls/internal/regtest/debug/debug_test.go @@ -0,0 +1,30 @@ +// Copyright 2022 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 debug + +import ( + "testing" + + "golang.org/x/tools/gopls/internal/hooks" + . "golang.org/x/tools/gopls/internal/lsp/regtest" + "golang.org/x/tools/internal/bug" +) + +func TestMain(m *testing.M) { + Main(m, hooks.Options) +} + +func TestBugNotification(t *testing.T) { + // Verify that a properly configured session gets notified of a bug on the + // server. + WithOptions( + Modes(Default), // must be in-process to receive the bug report below + Settings{"showBugReports": true}, + ).Run(t, "", func(t *testing.T, env *Env) { + const desc = "got a bug" + bug.Report(desc, nil) + env.Await(ShownMessage(desc)) + }) +} |