gopls: move marker tests to internal/test/marker
This directory now contains all the logic and all the
testdata files, using shorter file names. The test
name is just Test (sans Marker). The documentation
has moved to the package doc.go file.
Awaiter.TakeDocumentChanges was exported.
I checked that a mistake introduced into a .txtar
file continues to cause the test to fail.
Change-Id: I8383f3ad16451d87d27962600f8066d0b133564d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/546255
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/gopls/internal/lsp/regtest/env.go b/gopls/internal/lsp/regtest/env.go
index 43e4a0f..301cc21 100644
--- a/gopls/internal/lsp/regtest/env.go
+++ b/gopls/internal/lsp/regtest/env.go
@@ -311,9 +311,9 @@
}
}
-// takeDocumentChanges returns any accumulated document changes (from
+// TakeDocumentChanges returns any accumulated document changes (from
// server ApplyEdit RPC downcalls) and resets the list.
-func (a *Awaiter) takeDocumentChanges() []protocol.DocumentChanges {
+func (a *Awaiter) TakeDocumentChanges() []protocol.DocumentChanges {
a.mu.Lock()
defer a.mu.Unlock()
diff --git a/gopls/internal/regtest/marker/marker_test.go b/gopls/internal/regtest/marker/marker_test.go
deleted file mode 100644
index 006fb0f..0000000
--- a/gopls/internal/regtest/marker/marker_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2023 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 marker
-
-import (
- "os"
- "testing"
-
- . "golang.org/x/tools/gopls/internal/lsp/regtest"
- "golang.org/x/tools/gopls/internal/util/bug"
- "golang.org/x/tools/internal/testenv"
-)
-
-func TestMain(m *testing.M) {
- bug.PanicOnBugs = true
- testenv.ExitIfSmallMachine()
- os.Exit(m.Run())
-}
-
-// Note: we use a separate package for the marker tests so that we can easily
-// compare their performance to the existing marker tests in ./internal/lsp.
-
-// TestMarkers runs the marker tests from the testdata directory.
-//
-// See RunMarkerTests for details on how marker tests work.
-func TestMarkers(t *testing.T) {
- RunMarkerTests(t, "testdata")
-}
diff --git a/gopls/internal/test/marker/doc.go b/gopls/internal/test/marker/doc.go
new file mode 100644
index 0000000..aef4524
--- /dev/null
+++ b/gopls/internal/test/marker/doc.go
@@ -0,0 +1,366 @@
+// Copyright 2023 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 marker defines a framework for running "marker" tests, each
+defined by a file in the testdata subdirectory.
+
+Use this command to run the tests:
+
+ $ go test ./gopls/internal/test/marker [-update]
+
+A marker test uses the '//@' marker syntax of the x/tools/go/expect package
+to annotate source code with various information such as locations and
+arguments of LSP operations to be executed by the test. The syntax following
+'@' is parsed as a comma-separated list of ordinary Go function calls, for
+example
+
+ //@foo(a, "b", 3),bar(0)
+
+and delegates to a corresponding function to perform LSP-related operations.
+See the Marker types documentation below for a list of supported markers.
+
+Each call argument is converted to the type of the corresponding parameter of
+the designated function. The conversion logic may use the surrounding context,
+such as the position or nearby text. See the Argument conversion section below
+for the full set of special conversions. As a special case, the blank
+identifier '_' is treated as the zero value of the parameter type.
+
+The test runner collects test cases by searching the given directory for
+files with the .txt extension. Each file is interpreted as a txtar archive,
+which is extracted to a temporary directory. The relative path to the .txt
+file is used as the subtest name. The preliminary section of the file
+(before the first archive entry) is a free-form comment.
+
+These tests were inspired by (and in many places copied from) a previous
+iteration of the marker tests built on top of the packagestest framework.
+Key design decisions motivating this reimplementation are as follows:
+ - The old tests had a single global session, causing interaction at a
+ distance and several awkward workarounds.
+ - The old tests could not be safely parallelized, because certain tests
+ manipulated the server options
+ - Relatedly, the old tests did not have a logic grouping of assertions into
+ a single unit, resulting in clusters of files serving clusters of
+ entangled assertions.
+ - The old tests used locations in the source as test names and as the
+ identity of golden content, meaning that a single edit could change the
+ name of an arbitrary number of subtests, and making it difficult to
+ manually edit golden content.
+ - The old tests did not hew closely to LSP concepts, resulting in, for
+ example, each marker implementation doing its own position
+ transformations, and inventing its own mechanism for configuration.
+ - The old tests had an ad-hoc session initialization process. The regtest
+ environment has had more time devoted to its initialization, and has a
+ more convenient API.
+ - The old tests lacked documentation, and often had failures that were hard
+ to understand. By starting from scratch, we can revisit these aspects.
+
+# Special files
+
+There are several types of file within the test archive that are given special
+treatment by the test runner:
+ - "skip": the presence of this file causes the test to be skipped, with
+ the file content used as the skip message.
+ - "flags": this file is treated as a whitespace-separated list of flags
+ that configure the MarkerTest instance. Supported flags:
+ -min_go=go1.20 sets the minimum Go version for the test;
+ -cgo requires that CGO_ENABLED is set and the cgo tool is available
+ -write_sumfile=a,b,c instructs the test runner to generate go.sum files
+ in these directories before running the test.
+ -skip_goos=a,b,c instructs the test runner to skip the test for the
+ listed GOOS values.
+ -ignore_extra_diags suppresses errors for unmatched diagnostics
+ TODO(rfindley): using build constraint expressions for -skip_goos would
+ be clearer.
+ -filter_builtins=false disables the filtering of builtins from
+ completion results.
+ -filter_keywords=false disables the filtering of keywords from
+ completion results.
+ TODO(rfindley): support flag values containing whitespace.
+ - "settings.json": this file is parsed as JSON, and used as the
+ session configuration (see gopls/doc/settings.md)
+ - "capabilities.json": this file is parsed as JSON client capabilities,
+ and applied as an overlay over the default editor client capabilities.
+ see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities
+ for more details.
+ - "env": this file is parsed as a list of VAR=VALUE fields specifying the
+ editor environment.
+ - Golden files: Within the archive, file names starting with '@' are
+ treated as "golden" content, and are not written to disk, but instead are
+ made available to test methods expecting an argument of type *Golden,
+ using the identifier following '@'. For example, if the first parameter of
+ Foo were of type *Golden, the test runner would convert the identifier a
+ in the call @foo(a, "b", 3) into a *Golden by collecting golden file
+ data starting with "@a/".
+ - proxy files: any file starting with proxy/ is treated as a Go proxy
+ file. If present, these files are written to a separate temporary
+ directory and GOPROXY is set to file://<proxy directory>.
+
+# Marker types
+
+Markers are of two kinds. A few are "value markers" (e.g. @item), which are
+processed in a first pass and each computes a value that may be referred to
+by name later. Most are "action markers", which are processed in a second
+pass and take some action such as testing an LSP operation; they may refer
+to values computed by value markers.
+
+The following markers are supported within marker tests:
+
+ - acceptcompletion(location, label, golden): specifies that accepting the
+ completion candidate produced at the given location with provided label
+ results in the given golden state.
+
+ - codeaction(start, end, kind, golden, ...titles): specifies a code action
+ to request for the given range. To support multi-line ranges, the range
+ is defined to be between start.Start and end.End. The golden directory
+ contains changed file content after the code action is applied.
+ If titles are provided, they are used to filter the matching code
+ action.
+
+ TODO(rfindley): consolidate with codeactionedit, via a @loc2 marker that
+ allows binding multi-line locations.
+
+ - codeactionedit(range, kind, golden, ...titles): a shorter form of
+ codeaction. Invokes a code action of the given kind for the given
+ in-line range, and compares the resulting formatted unified *edits*
+ (notably, not the full file content) with the golden directory.
+
+ - codeactionerr(start, end, kind, wantError): specifies a codeaction that
+ fails with an error that matches the expectation.
+
+ - codelens(location, title): specifies that a codelens is expected at the
+ given location, with given title. Must be used in conjunction with
+ @codelenses.
+
+ - codelenses(): specifies that textDocument/codeLens should be run for the
+ current document, with results compared to the @codelens annotations in
+ the current document.
+
+ - complete(location, ...items): specifies expected completion results at
+ the given location. Must be used in conjunction with @item.
+
+ - diag(location, regexp): specifies an expected diagnostic matching the
+ given regexp at the given location. The test runner requires
+ a 1:1 correspondence between observed diagnostics and diag annotations.
+ The diagnostics source and kind fields are ignored, to reduce fuss.
+
+ The specified location must match the start position of the diagnostic,
+ but end positions are ignored.
+
+ TODO(adonovan): in the older marker framework, the annotation asserted
+ two additional fields (source="compiler", kind="error"). Restore them?
+
+ - def(src, dst location): perform a textDocument/definition request at
+ the src location, and check the result points to the dst location.
+
+ - documentLink(golden): asserts that textDocument/documentLink returns
+ links as described by the golden file.
+
+ - foldingrange(golden): perform a textDocument/foldingRange for the
+ current document, and compare with the golden content, which is the
+ original source annotated with numbered tags delimiting the resulting
+ ranges (e.g. <1 kind="..."> ... </1>).
+
+ - format(golden): perform a textDocument/format request for the enclosing
+ file, and compare against the named golden file. If the formatting
+ request succeeds, the golden file must contain the resulting formatted
+ source. If the formatting request fails, the golden file must contain
+ the error message.
+
+ - highlight(src location, dsts ...location): makes a
+ textDocument/highlight request at the given src location, which should
+ highlight the provided dst locations.
+
+ - hover(src, dst location, sm stringMatcher): perform a
+ textDocument/hover at the src location, and checks that the result is
+ the dst location, with matching hover content.
+
+ - implementations(src location, want ...location): makes a
+ textDocument/implementation query at the src location and
+ checks that the resulting set of locations matches want.
+
+ - incomingcalls(src location, want ...location): makes a
+ callHierarchy/incomingCalls query at the src location, and checks that
+ the set of call.From locations matches want.
+
+ - item(label, details, kind): defines a completion item with the provided
+ fields. This information is not positional, and therefore @item markers
+ may occur anywhere in the source. Used in conjunction with @complete,
+ snippet, or rank.
+
+ TODO(rfindley): rethink whether floating @item annotations are the best
+ way to specify completion results.
+
+ - loc(name, location): specifies the name for a location in the source. These
+ locations may be referenced by other markers.
+
+ - outgoingcalls(src location, want ...location): makes a
+ callHierarchy/outgoingCalls query at the src location, and checks that
+ the set of call.To locations matches want.
+
+ - preparerename(src, spn, placeholder): asserts that a textDocument/prepareRename
+ request at the src location expands to the spn location, with given
+ placeholder. If placeholder is "", this is treated as a negative
+ assertion and prepareRename should return nil.
+
+ - rename(location, new, golden): specifies a renaming of the
+ identifier at the specified location to the new name.
+ The golden directory contains the transformed files.
+
+ - renameerr(location, new, wantError): specifies a renaming that
+ fails with an error that matches the expectation.
+
+ - signature(location, label, active): specifies that
+ signatureHelp at the given location should match the provided string, with
+ the active parameter (an index) highlighted.
+
+ - suggestedfix(location, regexp, kind, golden): like diag, the location and
+ regexp identify an expected diagnostic. This diagnostic must
+ to have exactly one associated code action of the specified kind.
+ This action is executed for its editing effects on the source files.
+ Like rename, the golden directory contains the expected transformed files.
+
+ - suggestedfixerr(location, regexp, kind, wantError): specifies that the
+ suggestedfix operation should fail with an error that matches the expectation.
+ (Failures in the computation to offer a fix do not generally result
+ in LSP errors, so this marker is not appropriate for testing them.)
+
+ - rank(location, ...completionItem): executes a textDocument/completion
+ request at the given location, and verifies that each expected
+ completion item occurs in the results, in the expected order. Other
+ unexpected completion items may occur in the results.
+ TODO(rfindley): this exists for compatibility with the old marker tests.
+ Replace this with rankl, and rename.
+
+ - rankl(location, ...label): like rank, but only cares about completion
+ item labels.
+
+ - refs(location, want ...location): executes a textDocument/references
+ request at the first location and asserts that the result is the set of
+ 'want' locations. The first want location must be the declaration
+ (assumedly unique).
+
+ - snippet(location, completionItem, snippet): executes a
+ textDocument/completion request at the location, and searches for a
+ result with label matching that of the provided completion item
+ (TODO(rfindley): accept a label rather than a completion item). Check
+ the the result snippet matches the provided snippet.
+
+ - symbol(golden): makes a textDocument/documentSymbol request
+ for the enclosing file, formats the response with one symbol
+ per line, sorts it, and compares against the named golden file.
+ Each line is of the form:
+
+ dotted.symbol.name kind "detail" +n lines
+
+ where the "+n lines" part indicates that the declaration spans
+ several lines. The test otherwise makes no attempt to check
+ location information. There is no point to using more than one
+ @symbol marker in a given file.
+
+ - token(location, tokenType, mod): makes a textDocument/semanticTokens/range
+ request at the given location, and asserts that the result includes
+ exactly one token with the given token type and modifier string.
+
+ - workspacesymbol(query, golden): makes a workspace/symbol request for the
+ given query, formats the response with one symbol per line, and compares
+ against the named golden file. As workspace symbols are by definition a
+ workspace-wide request, the location of the workspace symbol marker does
+ not matter. Each line is of the form:
+
+ location name kind
+
+# Argument conversion
+
+Marker arguments are first parsed by the go/expect package, which accepts
+the following tokens as defined by the Go spec:
+ - string, int64, float64, and rune literals
+ - true and false
+ - nil
+ - identifiers (type expect.Identifier)
+ - regular expressions, denoted the two tokens re"abc" (type *regexp.Regexp)
+
+These values are passed as arguments to the corresponding parameter of the
+test function. Additional value conversions may occur for these argument ->
+parameter type pairs:
+ - string->regexp: the argument is parsed as a regular expressions.
+ - string->location: the argument is converted to the location of the first
+ instance of the argument in the partial line preceding the note.
+ - regexp->location: the argument is converted to the location of the first
+ match for the argument in the partial line preceding the note. If the
+ regular expression contains exactly one subgroup, the position of the
+ subgroup is used rather than the position of the submatch.
+ - name->location: the argument is replaced by the named location.
+ - name->Golden: the argument is used to look up golden content prefixed by
+ @<argument>.
+ - {string,regexp,identifier}->stringMatcher: a stringMatcher type
+ specifies an expected string, either in the form of a substring
+ that must be present, a regular expression that it must match, or an
+ identifier (e.g. foo) such that the archive entry @foo exists and
+ contains the exact expected string.
+ stringMatchers are used by some markers to match positive results
+ (outputs) and by other markers to match error messages.
+
+# Example
+
+Here is a complete example:
+
+ -- a.go --
+ package a
+
+ const abc = 0x2a //@hover("b", "abc", abc),hover(" =", "abc", abc)
+ -- @abc/hover.md --
+ ```go
+ const abc untyped int = 42
+ ```
+
+ @hover("b", "abc", abc),hover(" =", "abc", abc)
+
+In this example, the @hover annotation tells the test runner to run the
+hoverMarker function, which has parameters:
+
+ (mark marker, src, dsc protocol.Location, g *Golden).
+
+The first argument holds the test context, including fake editor with open
+files, and sandboxed directory.
+
+Argument converters translate the "b" and "abc" arguments into locations by
+interpreting each one as a regular expression and finding the location of
+its first match on the preceding portion of the line, and the abc identifier
+into a dictionary of golden content containing "hover.md". Then the
+hoverMarker method executes a textDocument/hover LSP request at the src
+position, and ensures the result spans "abc", with the markdown content from
+hover.md. (Note that the markdown content includes the expect annotation as
+the doc comment.)
+
+The next hover on the same line asserts the same result, but initiates the
+hover immediately after "abc" in the source. This tests that we find the
+preceding identifier when hovering.
+
+# Updating golden files
+
+To update golden content in the test archive, it is easier to regenerate
+content automatically rather than edit it by hand. To do this, run the
+tests with the -update flag. Only tests that actually run will be updated.
+
+In some cases, golden content will vary by Go version (for example, gopls
+produces different markdown at Go versions before the 1.19 go/doc update).
+By convention, the golden content in test archives should match the output
+at Go tip. Each test function can normalize golden content for older Go
+versions.
+
+Note that -update does not cause missing @diag or @loc markers to be added.
+
+# TODO
+
+ - Rename the files .txtar.
+ - Provide some means by which locations in the standard library
+ (or builtin.go) can be named, so that, for example, we can we
+ can assert that MyError implements the built-in error type.
+ - If possible, improve handling for optional arguments. Rather than have
+ multiple variations of a marker, it would be nice to support a more
+ flexible signature: can codeaction, codeactionedit, codeactionerr, and
+ suggestedfix be consolidated?
+*/
+package marker
diff --git a/gopls/internal/lsp/regtest/marker.go b/gopls/internal/test/marker/marker_test.go
similarity index 78%
rename from gopls/internal/lsp/regtest/marker.go
rename to gopls/internal/test/marker/marker_test.go
index c9dd1c0..840b871 100644
--- a/gopls/internal/lsp/regtest/marker.go
+++ b/gopls/internal/test/marker/marker_test.go
@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package regtest
+package marker
+
+// This file defines the marker test framework.
+// See doc.go for extensive documentation.
import (
"bytes"
@@ -25,6 +28,7 @@
"testing"
"github.com/google/go-cmp/cmp"
+
"golang.org/x/tools/go/expect"
"golang.org/x/tools/gopls/internal/hooks"
"golang.org/x/tools/gopls/internal/lsp/cache"
@@ -32,8 +36,10 @@
"golang.org/x/tools/gopls/internal/lsp/fake"
"golang.org/x/tools/gopls/internal/lsp/lsprpc"
"golang.org/x/tools/gopls/internal/lsp/protocol"
+ "golang.org/x/tools/gopls/internal/lsp/regtest"
"golang.org/x/tools/gopls/internal/lsp/safetoken"
"golang.org/x/tools/gopls/internal/lsp/tests/compare"
+ "golang.org/x/tools/gopls/internal/util/bug"
"golang.org/x/tools/internal/diff"
"golang.org/x/tools/internal/diff/myers"
"golang.org/x/tools/internal/jsonrpc2"
@@ -44,370 +50,17 @@
var update = flag.Bool("update", false, "if set, update test data during marker tests")
-// RunMarkerTests runs "marker" tests in the given test data directory.
-// (In practice: ../../regtest/marker/testdata)
+// Test runs the marker tests from the testdata directory.
//
-// Use this command to run the tests:
-//
-// $ go test ./gopls/internal/regtest/marker [-update]
-//
-// A marker test uses the '//@' marker syntax of the x/tools/go/expect package
-// to annotate source code with various information such as locations and
-// arguments of LSP operations to be executed by the test. The syntax following
-// '@' is parsed as a comma-separated list of ordinary Go function calls, for
-// example
-//
-// //@foo(a, "b", 3),bar(0)
-//
-// and delegates to a corresponding function to perform LSP-related operations.
-// See the Marker types documentation below for a list of supported markers.
-//
-// Each call argument is converted to the type of the corresponding parameter of
-// the designated function. The conversion logic may use the surrounding context,
-// such as the position or nearby text. See the Argument conversion section below
-// for the full set of special conversions. As a special case, the blank
-// identifier '_' is treated as the zero value of the parameter type.
-//
-// The test runner collects test cases by searching the given directory for
-// files with the .txt extension. Each file is interpreted as a txtar archive,
-// which is extracted to a temporary directory. The relative path to the .txt
-// file is used as the subtest name. The preliminary section of the file
-// (before the first archive entry) is a free-form comment.
-//
-// These tests were inspired by (and in many places copied from) a previous
-// iteration of the marker tests built on top of the packagestest framework.
-// Key design decisions motivating this reimplementation are as follows:
-// - The old tests had a single global session, causing interaction at a
-// distance and several awkward workarounds.
-// - The old tests could not be safely parallelized, because certain tests
-// manipulated the server options
-// - Relatedly, the old tests did not have a logic grouping of assertions into
-// a single unit, resulting in clusters of files serving clusters of
-// entangled assertions.
-// - The old tests used locations in the source as test names and as the
-// identity of golden content, meaning that a single edit could change the
-// name of an arbitrary number of subtests, and making it difficult to
-// manually edit golden content.
-// - The old tests did not hew closely to LSP concepts, resulting in, for
-// example, each marker implementation doing its own position
-// transformations, and inventing its own mechanism for configuration.
-// - The old tests had an ad-hoc session initialization process. The regtest
-// environment has had more time devoted to its initialization, and has a
-// more convenient API.
-// - The old tests lacked documentation, and often had failures that were hard
-// to understand. By starting from scratch, we can revisit these aspects.
-//
-// # Special files
-//
-// There are several types of file within the test archive that are given special
-// treatment by the test runner:
-// - "skip": the presence of this file causes the test to be skipped, with
-// the file content used as the skip message.
-// - "flags": this file is treated as a whitespace-separated list of flags
-// that configure the MarkerTest instance. Supported flags:
-// -min_go=go1.20 sets the minimum Go version for the test;
-// -cgo requires that CGO_ENABLED is set and the cgo tool is available
-// -write_sumfile=a,b,c instructs the test runner to generate go.sum files
-// in these directories before running the test.
-// -skip_goos=a,b,c instructs the test runner to skip the test for the
-// listed GOOS values.
-// -ignore_extra_diags suppresses errors for unmatched diagnostics
-// TODO(rfindley): using build constraint expressions for -skip_goos would
-// be clearer.
-// -filter_builtins=false disables the filtering of builtins from
-// completion results.
-// -filter_keywords=false disables the filtering of keywords from
-// completion results.
-// TODO(rfindley): support flag values containing whitespace.
-// - "settings.json": this file is parsed as JSON, and used as the
-// session configuration (see gopls/doc/settings.md)
-// - "capabilities.json": this file is parsed as JSON client capabilities,
-// and applied as an overlay over the default editor client capabilities.
-// see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities
-// for more details.
-// - "env": this file is parsed as a list of VAR=VALUE fields specifying the
-// editor environment.
-// - Golden files: Within the archive, file names starting with '@' are
-// treated as "golden" content, and are not written to disk, but instead are
-// made available to test methods expecting an argument of type *Golden,
-// using the identifier following '@'. For example, if the first parameter of
-// Foo were of type *Golden, the test runner would convert the identifier a
-// in the call @foo(a, "b", 3) into a *Golden by collecting golden file
-// data starting with "@a/".
-// - proxy files: any file starting with proxy/ is treated as a Go proxy
-// file. If present, these files are written to a separate temporary
-// directory and GOPROXY is set to file://<proxy directory>.
-//
-// # Marker types
-//
-// Markers are of two kinds. A few are "value markers" (e.g. @item), which are
-// processed in a first pass and each computes a value that may be referred to
-// by name later. Most are "action markers", which are processed in a second
-// pass and take some action such as testing an LSP operation; they may refer
-// to values computed by value markers.
-//
-// The following markers are supported within marker tests:
-//
-// - acceptcompletion(location, label, golden): specifies that accepting the
-// completion candidate produced at the given location with provided label
-// results in the given golden state.
-//
-// - codeaction(start, end, kind, golden, ...titles): specifies a code action
-// to request for the given range. To support multi-line ranges, the range
-// is defined to be between start.Start and end.End. The golden directory
-// contains changed file content after the code action is applied.
-// If titles are provided, they are used to filter the matching code
-// action.
-//
-// TODO(rfindley): consolidate with codeactionedit, via a @loc2 marker that
-// allows binding multi-line locations.
-//
-// - codeactionedit(range, kind, golden, ...titles): a shorter form of
-// codeaction. Invokes a code action of the given kind for the given
-// in-line range, and compares the resulting formatted unified *edits*
-// (notably, not the full file content) with the golden directory.
-//
-// - codeactionerr(start, end, kind, wantError): specifies a codeaction that
-// fails with an error that matches the expectation.
-//
-// - codelens(location, title): specifies that a codelens is expected at the
-// given location, with given title. Must be used in conjunction with
-// @codelenses.
-//
-// - codelenses(): specifies that textDocument/codeLens should be run for the
-// current document, with results compared to the @codelens annotations in
-// the current document.
-//
-// - complete(location, ...items): specifies expected completion results at
-// the given location. Must be used in conjunction with @item.
-//
-// - diag(location, regexp): specifies an expected diagnostic matching the
-// given regexp at the given location. The test runner requires
-// a 1:1 correspondence between observed diagnostics and diag annotations.
-// The diagnostics source and kind fields are ignored, to reduce fuss.
-//
-// The specified location must match the start position of the diagnostic,
-// but end positions are ignored.
-//
-// TODO(adonovan): in the older marker framework, the annotation asserted
-// two additional fields (source="compiler", kind="error"). Restore them?
-//
-// - def(src, dst location): perform a textDocument/definition request at
-// the src location, and check the result points to the dst location.
-//
-// - documentLink(golden): asserts that textDocument/documentLink returns
-// links as described by the golden file.
-//
-// - foldingrange(golden): perform a textDocument/foldingRange for the
-// current document, and compare with the golden content, which is the
-// original source annotated with numbered tags delimiting the resulting
-// ranges (e.g. <1 kind="..."> ... </1>).
-//
-// - format(golden): perform a textDocument/format request for the enclosing
-// file, and compare against the named golden file. If the formatting
-// request succeeds, the golden file must contain the resulting formatted
-// source. If the formatting request fails, the golden file must contain
-// the error message.
-//
-// - highlight(src location, dsts ...location): makes a
-// textDocument/highlight request at the given src location, which should
-// highlight the provided dst locations.
-//
-// - hover(src, dst location, sm stringMatcher): perform a
-// textDocument/hover at the src location, and checks that the result is
-// the dst location, with matching hover content.
-//
-// - implementations(src location, want ...location): makes a
-// textDocument/implementation query at the src location and
-// checks that the resulting set of locations matches want.
-//
-// - incomingcalls(src location, want ...location): makes a
-// callHierarchy/incomingCalls query at the src location, and checks that
-// the set of call.From locations matches want.
-//
-// - item(label, details, kind): defines a completion item with the provided
-// fields. This information is not positional, and therefore @item markers
-// may occur anywhere in the source. Used in conjunction with @complete,
-// snippet, or rank.
-//
-// TODO(rfindley): rethink whether floating @item annotations are the best
-// way to specify completion results.
-//
-// - loc(name, location): specifies the name for a location in the source. These
-// locations may be referenced by other markers.
-//
-// - outgoingcalls(src location, want ...location): makes a
-// callHierarchy/outgoingCalls query at the src location, and checks that
-// the set of call.To locations matches want.
-//
-// - preparerename(src, spn, placeholder): asserts that a textDocument/prepareRename
-// request at the src location expands to the spn location, with given
-// placeholder. If placeholder is "", this is treated as a negative
-// assertion and prepareRename should return nil.
-//
-// - rename(location, new, golden): specifies a renaming of the
-// identifier at the specified location to the new name.
-// The golden directory contains the transformed files.
-//
-// - renameerr(location, new, wantError): specifies a renaming that
-// fails with an error that matches the expectation.
-//
-// - signature(location, label, active): specifies that
-// signatureHelp at the given location should match the provided string, with
-// the active parameter (an index) highlighted.
-//
-// - suggestedfix(location, regexp, kind, golden): like diag, the location and
-// regexp identify an expected diagnostic. This diagnostic must
-// to have exactly one associated code action of the specified kind.
-// This action is executed for its editing effects on the source files.
-// Like rename, the golden directory contains the expected transformed files.
-//
-// - suggestedfixerr(location, regexp, kind, wantError): specifies that the
-// suggestedfix operation should fail with an error that matches the expectation.
-// (Failures in the computation to offer a fix do not generally result
-// in LSP errors, so this marker is not appropriate for testing them.)
-//
-// - rank(location, ...completionItem): executes a textDocument/completion
-// request at the given location, and verifies that each expected
-// completion item occurs in the results, in the expected order. Other
-// unexpected completion items may occur in the results.
-// TODO(rfindley): this exists for compatibility with the old marker tests.
-// Replace this with rankl, and rename.
-//
-// - rankl(location, ...label): like rank, but only cares about completion
-// item labels.
-//
-// - refs(location, want ...location): executes a textDocument/references
-// request at the first location and asserts that the result is the set of
-// 'want' locations. The first want location must be the declaration
-// (assumedly unique).
-//
-// - snippet(location, completionItem, snippet): executes a
-// textDocument/completion request at the location, and searches for a
-// result with label matching that of the provided completion item
-// (TODO(rfindley): accept a label rather than a completion item). Check
-// the the result snippet matches the provided snippet.
-//
-// - symbol(golden): makes a textDocument/documentSymbol request
-// for the enclosing file, formats the response with one symbol
-// per line, sorts it, and compares against the named golden file.
-// Each line is of the form:
-//
-// dotted.symbol.name kind "detail" +n lines
-//
-// where the "+n lines" part indicates that the declaration spans
-// several lines. The test otherwise makes no attempt to check
-// location information. There is no point to using more than one
-// @symbol marker in a given file.
-//
-// - token(location, tokenType, mod): makes a textDocument/semanticTokens/range
-// request at the given location, and asserts that the result includes
-// exactly one token with the given token type and modifier string.
-//
-// - workspacesymbol(query, golden): makes a workspace/symbol request for the
-// given query, formats the response with one symbol per line, and compares
-// against the named golden file. As workspace symbols are by definition a
-// workspace-wide request, the location of the workspace symbol marker does
-// not matter. Each line is of the form:
-//
-// location name kind
-//
-// # Argument conversion
-//
-// Marker arguments are first parsed by the go/expect package, which accepts
-// the following tokens as defined by the Go spec:
-// - string, int64, float64, and rune literals
-// - true and false
-// - nil
-// - identifiers (type expect.Identifier)
-// - regular expressions, denoted the two tokens re"abc" (type *regexp.Regexp)
-//
-// These values are passed as arguments to the corresponding parameter of the
-// test function. Additional value conversions may occur for these argument ->
-// parameter type pairs:
-// - string->regexp: the argument is parsed as a regular expressions.
-// - string->location: the argument is converted to the location of the first
-// instance of the argument in the partial line preceding the note.
-// - regexp->location: the argument is converted to the location of the first
-// match for the argument in the partial line preceding the note. If the
-// regular expression contains exactly one subgroup, the position of the
-// subgroup is used rather than the position of the submatch.
-// - name->location: the argument is replaced by the named location.
-// - name->Golden: the argument is used to look up golden content prefixed by
-// @<argument>.
-// - {string,regexp,identifier}->stringMatcher: a stringMatcher type
-// specifies an expected string, either in the form of a substring
-// that must be present, a regular expression that it must match, or an
-// identifier (e.g. foo) such that the archive entry @foo exists and
-// contains the exact expected string.
-// stringMatchers are used by some markers to match positive results
-// (outputs) and by other markers to match error messages.
-//
-// # Example
-//
-// Here is a complete example:
-//
-// -- a.go --
-// package a
-//
-// const abc = 0x2a //@hover("b", "abc", abc),hover(" =", "abc", abc)
-// -- @abc/hover.md --
-// ```go
-// const abc untyped int = 42
-// ```
-//
-// @hover("b", "abc", abc),hover(" =", "abc", abc)
-//
-// In this example, the @hover annotation tells the test runner to run the
-// hoverMarker function, which has parameters:
-//
-// (mark marker, src, dsc protocol.Location, g *Golden).
-//
-// The first argument holds the test context, including fake editor with open
-// files, and sandboxed directory.
-//
-// Argument converters translate the "b" and "abc" arguments into locations by
-// interpreting each one as a regular expression and finding the location of
-// its first match on the preceding portion of the line, and the abc identifier
-// into a dictionary of golden content containing "hover.md". Then the
-// hoverMarker method executes a textDocument/hover LSP request at the src
-// position, and ensures the result spans "abc", with the markdown content from
-// hover.md. (Note that the markdown content includes the expect annotation as
-// the doc comment.)
-//
-// The next hover on the same line asserts the same result, but initiates the
-// hover immediately after "abc" in the source. This tests that we find the
-// preceding identifier when hovering.
-//
-// # Updating golden files
-//
-// To update golden content in the test archive, it is easier to regenerate
-// content automatically rather than edit it by hand. To do this, run the
-// tests with the -update flag. Only tests that actually run will be updated.
-//
-// In some cases, golden content will vary by Go version (for example, gopls
-// produces different markdown at Go versions before the 1.19 go/doc update).
-// By convention, the golden content in test archives should match the output
-// at Go tip. Each test function can normalize golden content for older Go
-// versions.
-//
-// Note that -update does not cause missing @diag or @loc markers to be added.
-//
-// # TODO
-//
-// - reorganize regtest packages (and rename to just 'test'?)
-// - Rename the files .txtar.
-// - Provide some means by which locations in the standard library
-// (or builtin.go) can be named, so that, for example, we can we
-// can assert that MyError implements the built-in error type.
-// - If possible, improve handling for optional arguments. Rather than have
-// multiple variations of a marker, it would be nice to support a more
-// flexible signature: can codeaction, codeactionedit, codeactionerr, and
-// suggestedfix be consolidated?
-func RunMarkerTests(t *testing.T, dir string) {
+// See package documentation for details on how marker tests work.
+func Test(t *testing.T) {
+ bug.PanicOnBugs = true
+ testenv.ExitIfSmallMachine()
+
// The marker tests must be able to run go/packages.Load.
testenv.NeedsGoPackages(t)
+ const dir = "testdata"
tests, err := loadMarkerTests(dir)
if err != nil {
t.Fatal(err)
@@ -477,7 +130,7 @@
// Wait for the didOpen notifications to be processed, then collect
// diagnostics.
var diags map[string]*protocol.PublishDiagnosticsParams
- run.env.AfterChange(ReadAllDiagnostics(&diags))
+ run.env.AfterChange(regtest.ReadAllDiagnostics(&diags))
for path, params := range diags {
uri := run.env.Sandbox.Workdir.URI(path)
for _, diag := range params.Diagnostics {
@@ -1082,7 +735,7 @@
//
// TODO(rfindley): simplify and refactor the construction of testing
// environments across regtests, marker tests, and benchmarks.
-func newEnv(t *testing.T, cache *cache.Cache, files, proxyFiles map[string][]byte, writeGoSum []string, config fake.EditorConfig) *Env {
+func newEnv(t *testing.T, cache *cache.Cache, files, proxyFiles map[string][]byte, writeGoSum []string, config fake.EditorConfig) *regtest.Env {
sandbox, err := fake.NewSandbox(&fake.SandboxConfig{
RootDir: t.TempDir(),
Files: files,
@@ -1103,7 +756,7 @@
ctx := context.Background()
ctx = debug.WithInstance(ctx, "", "off")
- awaiter := NewAwaiter(sandbox.Workdir)
+ awaiter := regtest.NewAwaiter(sandbox.Workdir)
ss := lsprpc.NewStreamServer(cache, false, hooks.Options)
server := servertest.NewPipeServer(ss, jsonrpc2.NewRawStream)
const skipApplyEdits = true // capture edits but don't apply them
@@ -1112,11 +765,11 @@
sandbox.Close() // ignore error
t.Fatal(err)
}
- if err := awaiter.Await(ctx, InitialWorkspaceLoad); err != nil {
+ if err := awaiter.Await(ctx, regtest.InitialWorkspaceLoad); err != nil {
sandbox.Close() // ignore error
t.Fatal(err)
}
- return &Env{
+ return ®test.Env{
T: t,
Ctx: ctx,
Editor: editor,
@@ -1128,7 +781,7 @@
// A markerTestRun holds the state of one run of a marker test archive.
type markerTestRun struct {
test *markerTest
- env *Env
+ env *regtest.Env
settings map[string]any
// Collected information.
@@ -1942,7 +1595,7 @@
// rename returns the new contents of the files that would be modified
// by renaming the identifier at loc to newName.
-func rename(env *Env, loc protocol.Location, newName string) (map[string][]byte, error) {
+func rename(env *regtest.Env, loc protocol.Location, newName string) (map[string][]byte, error) {
// We call Server.Rename directly, instead of
// env.Editor.Rename(env.Ctx, loc, newName)
// to isolate Rename from PrepareRename, and because we don't
@@ -1969,7 +1622,7 @@
// content, recording the resulting contents in the fileChanges map. It is an
// error for a change to an edit a file that is already present in the
// fileChanges map.
-func applyDocumentChanges(env *Env, changes []protocol.DocumentChanges, fileChanges map[string][]byte) error {
+func applyDocumentChanges(env *regtest.Env, changes []protocol.DocumentChanges, fileChanges map[string][]byte) error {
getMapper := func(path string) (*protocol.Mapper, error) {
if _, ok := fileChanges[path]; ok {
return nil, fmt.Errorf("internal error: %s is already edited", path)
@@ -2149,7 +1802,7 @@
// The resulting map contains resulting file contents after the code action is
// applied. Currently, this function does not support code actions that return
// edits directly; it only supports code action commands.
-func codeAction(env *Env, uri protocol.DocumentURI, rng protocol.Range, actionKind string, diag *protocol.Diagnostic, titles []string) (map[string][]byte, error) {
+func codeAction(env *regtest.Env, uri protocol.DocumentURI, rng protocol.Range, actionKind string, diag *protocol.Diagnostic, titles []string) (map[string][]byte, error) {
changes, err := codeActionChanges(env, uri, rng, actionKind, diag, titles)
if err != nil {
return nil, err
@@ -2165,7 +1818,7 @@
// specified location and kind, and captures the resulting document changes.
// If diag is non-nil, it is used as the code action context.
// If titles is non-empty, the code action title must be present among the provided titles.
-func codeActionChanges(env *Env, uri protocol.DocumentURI, rng protocol.Range, actionKind string, diag *protocol.Diagnostic, titles []string) ([]protocol.DocumentChanges, error) {
+func codeActionChanges(env *regtest.Env, uri protocol.DocumentURI, rng protocol.Range, actionKind string, diag *protocol.Diagnostic, titles []string) ([]protocol.DocumentChanges, error) {
// Request all code actions that apply to the diagnostic.
// (The protocol supports filtering using Context.Only={actionKind}
// but we can give a better error if we don't filter.)
@@ -2243,7 +1896,7 @@
// The server then makes an ApplyEdit RPC to the client,
// whose Awaiter hook gathers the edits instead of applying them.
- _ = env.Awaiter.takeDocumentChanges() // reset (assuming Env is confined to this thread)
+ _ = env.Awaiter.TakeDocumentChanges() // reset (assuming Env is confined to this thread)
if _, err := env.Editor.Server.ExecuteCommand(env.Ctx, &protocol.ExecuteCommandParams{
Command: action.Command.Command,
@@ -2251,7 +1904,7 @@
}); err != nil {
return nil, err
}
- return env.Awaiter.takeDocumentChanges(), nil
+ return env.Awaiter.TakeDocumentChanges(), nil
}
return nil, nil
diff --git a/gopls/internal/regtest/marker/testdata/callhierarchy/callhierarchy.txt b/gopls/internal/test/marker/testdata/callhierarchy/callhierarchy.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/callhierarchy/callhierarchy.txt
rename to gopls/internal/test/marker/testdata/callhierarchy/callhierarchy.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/change_quote.txt b/gopls/internal/test/marker/testdata/codeaction/change_quote.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/change_quote.txt
rename to gopls/internal/test/marker/testdata/codeaction/change_quote.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/extract_method.txt b/gopls/internal/test/marker/testdata/codeaction/extract_method.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/extract_method.txt
rename to gopls/internal/test/marker/testdata/codeaction/extract_method.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/extract_variable.txt b/gopls/internal/test/marker/testdata/codeaction/extract_variable.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/extract_variable.txt
rename to gopls/internal/test/marker/testdata/codeaction/extract_variable.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/fill_struct.txt b/gopls/internal/test/marker/testdata/codeaction/fill_struct.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/fill_struct.txt
rename to gopls/internal/test/marker/testdata/codeaction/fill_struct.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/functionextraction.txt b/gopls/internal/test/marker/testdata/codeaction/functionextraction.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/functionextraction.txt
rename to gopls/internal/test/marker/testdata/codeaction/functionextraction.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/functionextraction_issue44813.txt b/gopls/internal/test/marker/testdata/codeaction/functionextraction_issue44813.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/functionextraction_issue44813.txt
rename to gopls/internal/test/marker/testdata/codeaction/functionextraction_issue44813.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/imports.txt b/gopls/internal/test/marker/testdata/codeaction/imports.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/imports.txt
rename to gopls/internal/test/marker/testdata/codeaction/imports.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/infertypeargs.txt b/gopls/internal/test/marker/testdata/codeaction/infertypeargs.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/infertypeargs.txt
rename to gopls/internal/test/marker/testdata/codeaction/infertypeargs.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/inline.txt b/gopls/internal/test/marker/testdata/codeaction/inline.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/inline.txt
rename to gopls/internal/test/marker/testdata/codeaction/inline.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/invertif.txt b/gopls/internal/test/marker/testdata/codeaction/invertif.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/invertif.txt
rename to gopls/internal/test/marker/testdata/codeaction/invertif.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/removeparam.txt b/gopls/internal/test/marker/testdata/codeaction/removeparam.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/removeparam.txt
rename to gopls/internal/test/marker/testdata/codeaction/removeparam.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/removeparam_formatting.txt b/gopls/internal/test/marker/testdata/codeaction/removeparam_formatting.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/removeparam_formatting.txt
rename to gopls/internal/test/marker/testdata/codeaction/removeparam_formatting.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/removeparam_funcvalue.txt b/gopls/internal/test/marker/testdata/codeaction/removeparam_funcvalue.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/removeparam_funcvalue.txt
rename to gopls/internal/test/marker/testdata/codeaction/removeparam_funcvalue.txt
diff --git a/gopls/internal/regtest/marker/testdata/codeaction/removeparam_imports.txt b/gopls/internal/test/marker/testdata/codeaction/removeparam_imports.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codeaction/removeparam_imports.txt
rename to gopls/internal/test/marker/testdata/codeaction/removeparam_imports.txt
diff --git a/gopls/internal/regtest/marker/testdata/codelens/generate.txt b/gopls/internal/test/marker/testdata/codelens/generate.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codelens/generate.txt
rename to gopls/internal/test/marker/testdata/codelens/generate.txt
diff --git a/gopls/internal/regtest/marker/testdata/codelens/test.txt b/gopls/internal/test/marker/testdata/codelens/test.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/codelens/test.txt
rename to gopls/internal/test/marker/testdata/codelens/test.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/address.txt b/gopls/internal/test/marker/testdata/completion/address.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/address.txt
rename to gopls/internal/test/marker/testdata/completion/address.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/anon.txt b/gopls/internal/test/marker/testdata/completion/anon.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/anon.txt
rename to gopls/internal/test/marker/testdata/completion/anon.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/append.txt b/gopls/internal/test/marker/testdata/completion/append.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/append.txt
rename to gopls/internal/test/marker/testdata/completion/append.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/assign.txt b/gopls/internal/test/marker/testdata/completion/assign.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/assign.txt
rename to gopls/internal/test/marker/testdata/completion/assign.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/bad.txt b/gopls/internal/test/marker/testdata/completion/bad.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/bad.txt
rename to gopls/internal/test/marker/testdata/completion/bad.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/basic_lit.txt b/gopls/internal/test/marker/testdata/completion/basic_lit.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/basic_lit.txt
rename to gopls/internal/test/marker/testdata/completion/basic_lit.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/builtins.txt b/gopls/internal/test/marker/testdata/completion/builtins.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/builtins.txt
rename to gopls/internal/test/marker/testdata/completion/builtins.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/casesensitive.txt b/gopls/internal/test/marker/testdata/completion/casesensitive.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/casesensitive.txt
rename to gopls/internal/test/marker/testdata/completion/casesensitive.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/cast.txt b/gopls/internal/test/marker/testdata/completion/cast.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/cast.txt
rename to gopls/internal/test/marker/testdata/completion/cast.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/channel.txt b/gopls/internal/test/marker/testdata/completion/channel.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/channel.txt
rename to gopls/internal/test/marker/testdata/completion/channel.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/comment.txt b/gopls/internal/test/marker/testdata/completion/comment.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/comment.txt
rename to gopls/internal/test/marker/testdata/completion/comment.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/complit.txt b/gopls/internal/test/marker/testdata/completion/complit.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/complit.txt
rename to gopls/internal/test/marker/testdata/completion/complit.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/constant.txt b/gopls/internal/test/marker/testdata/completion/constant.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/constant.txt
rename to gopls/internal/test/marker/testdata/completion/constant.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/danglingstmt.txt b/gopls/internal/test/marker/testdata/completion/danglingstmt.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/danglingstmt.txt
rename to gopls/internal/test/marker/testdata/completion/danglingstmt.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/deep.txt b/gopls/internal/test/marker/testdata/completion/deep.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/deep.txt
rename to gopls/internal/test/marker/testdata/completion/deep.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/deep2.txt b/gopls/internal/test/marker/testdata/completion/deep2.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/deep2.txt
rename to gopls/internal/test/marker/testdata/completion/deep2.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/errors.txt b/gopls/internal/test/marker/testdata/completion/errors.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/errors.txt
rename to gopls/internal/test/marker/testdata/completion/errors.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/field_list.txt b/gopls/internal/test/marker/testdata/completion/field_list.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/field_list.txt
rename to gopls/internal/test/marker/testdata/completion/field_list.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/foobarbaz.txt b/gopls/internal/test/marker/testdata/completion/foobarbaz.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/foobarbaz.txt
rename to gopls/internal/test/marker/testdata/completion/foobarbaz.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/func_rank.txt b/gopls/internal/test/marker/testdata/completion/func_rank.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/func_rank.txt
rename to gopls/internal/test/marker/testdata/completion/func_rank.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/func_sig.txt b/gopls/internal/test/marker/testdata/completion/func_sig.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/func_sig.txt
rename to gopls/internal/test/marker/testdata/completion/func_sig.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/func_snippets.txt b/gopls/internal/test/marker/testdata/completion/func_snippets.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/func_snippets.txt
rename to gopls/internal/test/marker/testdata/completion/func_snippets.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/func_value.txt b/gopls/internal/test/marker/testdata/completion/func_value.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/func_value.txt
rename to gopls/internal/test/marker/testdata/completion/func_value.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/fuzzy.txt b/gopls/internal/test/marker/testdata/completion/fuzzy.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/fuzzy.txt
rename to gopls/internal/test/marker/testdata/completion/fuzzy.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/index.txt b/gopls/internal/test/marker/testdata/completion/index.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/index.txt
rename to gopls/internal/test/marker/testdata/completion/index.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/interfacerank.txt b/gopls/internal/test/marker/testdata/completion/interfacerank.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/interfacerank.txt
rename to gopls/internal/test/marker/testdata/completion/interfacerank.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/issue56505.txt b/gopls/internal/test/marker/testdata/completion/issue56505.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/issue56505.txt
rename to gopls/internal/test/marker/testdata/completion/issue56505.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/issue59096.txt b/gopls/internal/test/marker/testdata/completion/issue59096.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/issue59096.txt
rename to gopls/internal/test/marker/testdata/completion/issue59096.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/issue60545.txt b/gopls/internal/test/marker/testdata/completion/issue60545.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/issue60545.txt
rename to gopls/internal/test/marker/testdata/completion/issue60545.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/issue62141.txt b/gopls/internal/test/marker/testdata/completion/issue62141.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/issue62141.txt
rename to gopls/internal/test/marker/testdata/completion/issue62141.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/issue62560.txt b/gopls/internal/test/marker/testdata/completion/issue62560.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/issue62560.txt
rename to gopls/internal/test/marker/testdata/completion/issue62560.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/issue62676.txt b/gopls/internal/test/marker/testdata/completion/issue62676.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/issue62676.txt
rename to gopls/internal/test/marker/testdata/completion/issue62676.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/keywords.txt b/gopls/internal/test/marker/testdata/completion/keywords.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/keywords.txt
rename to gopls/internal/test/marker/testdata/completion/keywords.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/labels.txt b/gopls/internal/test/marker/testdata/completion/labels.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/labels.txt
rename to gopls/internal/test/marker/testdata/completion/labels.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/lit.txt b/gopls/internal/test/marker/testdata/completion/lit.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/lit.txt
rename to gopls/internal/test/marker/testdata/completion/lit.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/maps.txt b/gopls/internal/test/marker/testdata/completion/maps.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/maps.txt
rename to gopls/internal/test/marker/testdata/completion/maps.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/multi_return.txt b/gopls/internal/test/marker/testdata/completion/multi_return.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/multi_return.txt
rename to gopls/internal/test/marker/testdata/completion/multi_return.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/nested_complit.txt b/gopls/internal/test/marker/testdata/completion/nested_complit.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/nested_complit.txt
rename to gopls/internal/test/marker/testdata/completion/nested_complit.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/postfix.txt b/gopls/internal/test/marker/testdata/completion/postfix.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/postfix.txt
rename to gopls/internal/test/marker/testdata/completion/postfix.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/printf.txt b/gopls/internal/test/marker/testdata/completion/printf.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/printf.txt
rename to gopls/internal/test/marker/testdata/completion/printf.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/rank.txt b/gopls/internal/test/marker/testdata/completion/rank.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/rank.txt
rename to gopls/internal/test/marker/testdata/completion/rank.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/snippet.txt b/gopls/internal/test/marker/testdata/completion/snippet.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/snippet.txt
rename to gopls/internal/test/marker/testdata/completion/snippet.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/snippet_placeholder.txt b/gopls/internal/test/marker/testdata/completion/snippet_placeholder.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/snippet_placeholder.txt
rename to gopls/internal/test/marker/testdata/completion/snippet_placeholder.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/statements.txt b/gopls/internal/test/marker/testdata/completion/statements.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/statements.txt
rename to gopls/internal/test/marker/testdata/completion/statements.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/testy.txt b/gopls/internal/test/marker/testdata/completion/testy.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/testy.txt
rename to gopls/internal/test/marker/testdata/completion/testy.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/type_assert.txt b/gopls/internal/test/marker/testdata/completion/type_assert.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/type_assert.txt
rename to gopls/internal/test/marker/testdata/completion/type_assert.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/type_mods.txt b/gopls/internal/test/marker/testdata/completion/type_mods.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/type_mods.txt
rename to gopls/internal/test/marker/testdata/completion/type_mods.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/type_params.txt b/gopls/internal/test/marker/testdata/completion/type_params.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/type_params.txt
rename to gopls/internal/test/marker/testdata/completion/type_params.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/unimported.txt b/gopls/internal/test/marker/testdata/completion/unimported.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/unimported.txt
rename to gopls/internal/test/marker/testdata/completion/unimported.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/unresolved.txt b/gopls/internal/test/marker/testdata/completion/unresolved.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/unresolved.txt
rename to gopls/internal/test/marker/testdata/completion/unresolved.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/unsafe.txt b/gopls/internal/test/marker/testdata/completion/unsafe.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/unsafe.txt
rename to gopls/internal/test/marker/testdata/completion/unsafe.txt
diff --git a/gopls/internal/regtest/marker/testdata/completion/variadic.txt b/gopls/internal/test/marker/testdata/completion/variadic.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/completion/variadic.txt
rename to gopls/internal/test/marker/testdata/completion/variadic.txt
diff --git a/gopls/internal/regtest/marker/testdata/definition/cgo.txt b/gopls/internal/test/marker/testdata/definition/cgo.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/definition/cgo.txt
rename to gopls/internal/test/marker/testdata/definition/cgo.txt
diff --git a/gopls/internal/regtest/marker/testdata/definition/embed.txt b/gopls/internal/test/marker/testdata/definition/embed.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/definition/embed.txt
rename to gopls/internal/test/marker/testdata/definition/embed.txt
diff --git a/gopls/internal/regtest/marker/testdata/definition/import.txt b/gopls/internal/test/marker/testdata/definition/import.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/definition/import.txt
rename to gopls/internal/test/marker/testdata/definition/import.txt
diff --git a/gopls/internal/regtest/marker/testdata/definition/misc.txt b/gopls/internal/test/marker/testdata/definition/misc.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/definition/misc.txt
rename to gopls/internal/test/marker/testdata/definition/misc.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/addgowork.txt b/gopls/internal/test/marker/testdata/diagnostics/addgowork.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/addgowork.txt
rename to gopls/internal/test/marker/testdata/diagnostics/addgowork.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/analyzers.txt b/gopls/internal/test/marker/testdata/diagnostics/analyzers.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/analyzers.txt
rename to gopls/internal/test/marker/testdata/diagnostics/analyzers.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/excludedfile.txt b/gopls/internal/test/marker/testdata/diagnostics/excludedfile.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/excludedfile.txt
rename to gopls/internal/test/marker/testdata/diagnostics/excludedfile.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/generated.txt b/gopls/internal/test/marker/testdata/diagnostics/generated.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/generated.txt
rename to gopls/internal/test/marker/testdata/diagnostics/generated.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/issue56943.txt b/gopls/internal/test/marker/testdata/diagnostics/issue56943.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/issue56943.txt
rename to gopls/internal/test/marker/testdata/diagnostics/issue56943.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/issue59005.txt b/gopls/internal/test/marker/testdata/diagnostics/issue59005.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/issue59005.txt
rename to gopls/internal/test/marker/testdata/diagnostics/issue59005.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/issue60544.txt b/gopls/internal/test/marker/testdata/diagnostics/issue60544.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/issue60544.txt
rename to gopls/internal/test/marker/testdata/diagnostics/issue60544.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/issue60605.txt b/gopls/internal/test/marker/testdata/diagnostics/issue60605.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/issue60605.txt
rename to gopls/internal/test/marker/testdata/diagnostics/issue60605.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/parseerr.txt b/gopls/internal/test/marker/testdata/diagnostics/parseerr.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/parseerr.txt
rename to gopls/internal/test/marker/testdata/diagnostics/parseerr.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/rundespiteerrors.txt b/gopls/internal/test/marker/testdata/diagnostics/rundespiteerrors.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/rundespiteerrors.txt
rename to gopls/internal/test/marker/testdata/diagnostics/rundespiteerrors.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/strangefiles.txt b/gopls/internal/test/marker/testdata/diagnostics/strangefiles.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/strangefiles.txt
rename to gopls/internal/test/marker/testdata/diagnostics/strangefiles.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/typeerr.txt b/gopls/internal/test/marker/testdata/diagnostics/typeerr.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/typeerr.txt
rename to gopls/internal/test/marker/testdata/diagnostics/typeerr.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/useinternal.txt b/gopls/internal/test/marker/testdata/diagnostics/useinternal.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/useinternal.txt
rename to gopls/internal/test/marker/testdata/diagnostics/useinternal.txt
diff --git a/gopls/internal/regtest/marker/testdata/diagnostics/usemodule.txt b/gopls/internal/test/marker/testdata/diagnostics/usemodule.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/diagnostics/usemodule.txt
rename to gopls/internal/test/marker/testdata/diagnostics/usemodule.txt
diff --git a/gopls/internal/regtest/marker/testdata/fixedbugs/issue59318.txt b/gopls/internal/test/marker/testdata/fixedbugs/issue59318.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/fixedbugs/issue59318.txt
rename to gopls/internal/test/marker/testdata/fixedbugs/issue59318.txt
diff --git a/gopls/internal/regtest/marker/testdata/fixedbugs/issue59944.txt b/gopls/internal/test/marker/testdata/fixedbugs/issue59944.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/fixedbugs/issue59944.txt
rename to gopls/internal/test/marker/testdata/fixedbugs/issue59944.txt
diff --git a/gopls/internal/regtest/marker/testdata/foldingrange/a.txt b/gopls/internal/test/marker/testdata/foldingrange/a.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/foldingrange/a.txt
rename to gopls/internal/test/marker/testdata/foldingrange/a.txt
diff --git a/gopls/internal/regtest/marker/testdata/foldingrange/a_lineonly.txt b/gopls/internal/test/marker/testdata/foldingrange/a_lineonly.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/foldingrange/a_lineonly.txt
rename to gopls/internal/test/marker/testdata/foldingrange/a_lineonly.txt
diff --git a/gopls/internal/regtest/marker/testdata/foldingrange/bad.txt b/gopls/internal/test/marker/testdata/foldingrange/bad.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/foldingrange/bad.txt
rename to gopls/internal/test/marker/testdata/foldingrange/bad.txt
diff --git a/gopls/internal/regtest/marker/testdata/format/format.txt b/gopls/internal/test/marker/testdata/format/format.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/format/format.txt
rename to gopls/internal/test/marker/testdata/format/format.txt
diff --git a/gopls/internal/regtest/marker/testdata/format/issue59554.txt b/gopls/internal/test/marker/testdata/format/issue59554.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/format/issue59554.txt
rename to gopls/internal/test/marker/testdata/format/issue59554.txt
diff --git a/gopls/internal/regtest/marker/testdata/format/noparse.txt b/gopls/internal/test/marker/testdata/format/noparse.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/format/noparse.txt
rename to gopls/internal/test/marker/testdata/format/noparse.txt
diff --git a/gopls/internal/regtest/marker/testdata/highlight/highlight.txt b/gopls/internal/test/marker/testdata/highlight/highlight.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/highlight/highlight.txt
rename to gopls/internal/test/marker/testdata/highlight/highlight.txt
diff --git a/gopls/internal/regtest/marker/testdata/highlight/issue60435.txt b/gopls/internal/test/marker/testdata/highlight/issue60435.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/highlight/issue60435.txt
rename to gopls/internal/test/marker/testdata/highlight/issue60435.txt
diff --git a/gopls/internal/regtest/marker/testdata/hover/basiclit.txt b/gopls/internal/test/marker/testdata/hover/basiclit.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/hover/basiclit.txt
rename to gopls/internal/test/marker/testdata/hover/basiclit.txt
diff --git a/gopls/internal/regtest/marker/testdata/hover/const.txt b/gopls/internal/test/marker/testdata/hover/const.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/hover/const.txt
rename to gopls/internal/test/marker/testdata/hover/const.txt
diff --git a/gopls/internal/regtest/marker/testdata/hover/generics.txt b/gopls/internal/test/marker/testdata/hover/generics.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/hover/generics.txt
rename to gopls/internal/test/marker/testdata/hover/generics.txt
diff --git a/gopls/internal/regtest/marker/testdata/hover/godef.txt b/gopls/internal/test/marker/testdata/hover/godef.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/hover/godef.txt
rename to gopls/internal/test/marker/testdata/hover/godef.txt
diff --git a/gopls/internal/regtest/marker/testdata/hover/goprivate.txt b/gopls/internal/test/marker/testdata/hover/goprivate.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/hover/goprivate.txt
rename to gopls/internal/test/marker/testdata/hover/goprivate.txt
diff --git a/gopls/internal/regtest/marker/testdata/hover/hover.txt b/gopls/internal/test/marker/testdata/hover/hover.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/hover/hover.txt
rename to gopls/internal/test/marker/testdata/hover/hover.txt
diff --git a/gopls/internal/regtest/marker/testdata/hover/issue64239.txt b/gopls/internal/test/marker/testdata/hover/issue64239.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/hover/issue64239.txt
rename to gopls/internal/test/marker/testdata/hover/issue64239.txt
diff --git a/gopls/internal/regtest/marker/testdata/hover/linkable.txt b/gopls/internal/test/marker/testdata/hover/linkable.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/hover/linkable.txt
rename to gopls/internal/test/marker/testdata/hover/linkable.txt
diff --git a/gopls/internal/regtest/marker/testdata/hover/linkable_generics.txt b/gopls/internal/test/marker/testdata/hover/linkable_generics.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/hover/linkable_generics.txt
rename to gopls/internal/test/marker/testdata/hover/linkable_generics.txt
diff --git a/gopls/internal/regtest/marker/testdata/hover/linkname.txt b/gopls/internal/test/marker/testdata/hover/linkname.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/hover/linkname.txt
rename to gopls/internal/test/marker/testdata/hover/linkname.txt
diff --git a/gopls/internal/regtest/marker/testdata/hover/std.txt b/gopls/internal/test/marker/testdata/hover/std.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/hover/std.txt
rename to gopls/internal/test/marker/testdata/hover/std.txt
diff --git a/gopls/internal/regtest/marker/testdata/implementation/basic.txt b/gopls/internal/test/marker/testdata/implementation/basic.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/implementation/basic.txt
rename to gopls/internal/test/marker/testdata/implementation/basic.txt
diff --git a/gopls/internal/regtest/marker/testdata/implementation/generics.txt b/gopls/internal/test/marker/testdata/implementation/generics.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/implementation/generics.txt
rename to gopls/internal/test/marker/testdata/implementation/generics.txt
diff --git a/gopls/internal/regtest/marker/testdata/implementation/issue43655.txt b/gopls/internal/test/marker/testdata/implementation/issue43655.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/implementation/issue43655.txt
rename to gopls/internal/test/marker/testdata/implementation/issue43655.txt
diff --git a/gopls/internal/regtest/marker/testdata/inlayhints/inlayhints.txt b/gopls/internal/test/marker/testdata/inlayhints/inlayhints.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/inlayhints/inlayhints.txt
rename to gopls/internal/test/marker/testdata/inlayhints/inlayhints.txt
diff --git a/gopls/internal/regtest/marker/testdata/links/links.txt b/gopls/internal/test/marker/testdata/links/links.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/links/links.txt
rename to gopls/internal/test/marker/testdata/links/links.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/crosspackage.txt b/gopls/internal/test/marker/testdata/references/crosspackage.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/crosspackage.txt
rename to gopls/internal/test/marker/testdata/references/crosspackage.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/imports.txt b/gopls/internal/test/marker/testdata/references/imports.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/imports.txt
rename to gopls/internal/test/marker/testdata/references/imports.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/interfaces.txt b/gopls/internal/test/marker/testdata/references/interfaces.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/interfaces.txt
rename to gopls/internal/test/marker/testdata/references/interfaces.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/intrapackage.txt b/gopls/internal/test/marker/testdata/references/intrapackage.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/intrapackage.txt
rename to gopls/internal/test/marker/testdata/references/intrapackage.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/issue58506.txt b/gopls/internal/test/marker/testdata/references/issue58506.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/issue58506.txt
rename to gopls/internal/test/marker/testdata/references/issue58506.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/issue59851.txt b/gopls/internal/test/marker/testdata/references/issue59851.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/issue59851.txt
rename to gopls/internal/test/marker/testdata/references/issue59851.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/issue60369.txt b/gopls/internal/test/marker/testdata/references/issue60369.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/issue60369.txt
rename to gopls/internal/test/marker/testdata/references/issue60369.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/issue60622.txt b/gopls/internal/test/marker/testdata/references/issue60622.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/issue60622.txt
rename to gopls/internal/test/marker/testdata/references/issue60622.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/issue60676.txt b/gopls/internal/test/marker/testdata/references/issue60676.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/issue60676.txt
rename to gopls/internal/test/marker/testdata/references/issue60676.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/issue61618.txt b/gopls/internal/test/marker/testdata/references/issue61618.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/issue61618.txt
rename to gopls/internal/test/marker/testdata/references/issue61618.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/shadow.txt b/gopls/internal/test/marker/testdata/references/shadow.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/shadow.txt
rename to gopls/internal/test/marker/testdata/references/shadow.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/test.txt b/gopls/internal/test/marker/testdata/references/test.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/test.txt
rename to gopls/internal/test/marker/testdata/references/test.txt
diff --git a/gopls/internal/regtest/marker/testdata/references/typeswitch.txt b/gopls/internal/test/marker/testdata/references/typeswitch.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/references/typeswitch.txt
rename to gopls/internal/test/marker/testdata/references/typeswitch.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/bad.txt b/gopls/internal/test/marker/testdata/rename/bad.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/bad.txt
rename to gopls/internal/test/marker/testdata/rename/bad.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/basic.txt b/gopls/internal/test/marker/testdata/rename/basic.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/basic.txt
rename to gopls/internal/test/marker/testdata/rename/basic.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/conflict.txt b/gopls/internal/test/marker/testdata/rename/conflict.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/conflict.txt
rename to gopls/internal/test/marker/testdata/rename/conflict.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/crosspkg.txt b/gopls/internal/test/marker/testdata/rename/crosspkg.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/crosspkg.txt
rename to gopls/internal/test/marker/testdata/rename/crosspkg.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/embed.txt b/gopls/internal/test/marker/testdata/rename/embed.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/embed.txt
rename to gopls/internal/test/marker/testdata/rename/embed.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/generics.txt b/gopls/internal/test/marker/testdata/rename/generics.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/generics.txt
rename to gopls/internal/test/marker/testdata/rename/generics.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/generics_basic.txt b/gopls/internal/test/marker/testdata/rename/generics_basic.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/generics_basic.txt
rename to gopls/internal/test/marker/testdata/rename/generics_basic.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/issue39614.txt b/gopls/internal/test/marker/testdata/rename/issue39614.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/issue39614.txt
rename to gopls/internal/test/marker/testdata/rename/issue39614.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/issue42134.txt b/gopls/internal/test/marker/testdata/rename/issue42134.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/issue42134.txt
rename to gopls/internal/test/marker/testdata/rename/issue42134.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/issue43616.txt b/gopls/internal/test/marker/testdata/rename/issue43616.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/issue43616.txt
rename to gopls/internal/test/marker/testdata/rename/issue43616.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/issue60789.txt b/gopls/internal/test/marker/testdata/rename/issue60789.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/issue60789.txt
rename to gopls/internal/test/marker/testdata/rename/issue60789.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/issue61294.txt b/gopls/internal/test/marker/testdata/rename/issue61294.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/issue61294.txt
rename to gopls/internal/test/marker/testdata/rename/issue61294.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/issue61640.txt b/gopls/internal/test/marker/testdata/rename/issue61640.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/issue61640.txt
rename to gopls/internal/test/marker/testdata/rename/issue61640.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/issue61813.txt b/gopls/internal/test/marker/testdata/rename/issue61813.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/issue61813.txt
rename to gopls/internal/test/marker/testdata/rename/issue61813.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/methods.txt b/gopls/internal/test/marker/testdata/rename/methods.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/methods.txt
rename to gopls/internal/test/marker/testdata/rename/methods.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/prepare.txt b/gopls/internal/test/marker/testdata/rename/prepare.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/prepare.txt
rename to gopls/internal/test/marker/testdata/rename/prepare.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/random.txt b/gopls/internal/test/marker/testdata/rename/random.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/random.txt
rename to gopls/internal/test/marker/testdata/rename/random.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/shadow.txt b/gopls/internal/test/marker/testdata/rename/shadow.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/shadow.txt
rename to gopls/internal/test/marker/testdata/rename/shadow.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/testy.txt b/gopls/internal/test/marker/testdata/rename/testy.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/testy.txt
rename to gopls/internal/test/marker/testdata/rename/testy.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/typeswitch.txt b/gopls/internal/test/marker/testdata/rename/typeswitch.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/typeswitch.txt
rename to gopls/internal/test/marker/testdata/rename/typeswitch.txt
diff --git a/gopls/internal/regtest/marker/testdata/rename/unexported.txt b/gopls/internal/test/marker/testdata/rename/unexported.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/rename/unexported.txt
rename to gopls/internal/test/marker/testdata/rename/unexported.txt
diff --git a/gopls/internal/regtest/marker/testdata/selectionrange/selectionrange.txt b/gopls/internal/test/marker/testdata/selectionrange/selectionrange.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/selectionrange/selectionrange.txt
rename to gopls/internal/test/marker/testdata/selectionrange/selectionrange.txt
diff --git a/gopls/internal/regtest/marker/testdata/signature/generic.txt b/gopls/internal/test/marker/testdata/signature/generic.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/signature/generic.txt
rename to gopls/internal/test/marker/testdata/signature/generic.txt
diff --git a/gopls/internal/regtest/marker/testdata/signature/issue63804.txt b/gopls/internal/test/marker/testdata/signature/issue63804.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/signature/issue63804.txt
rename to gopls/internal/test/marker/testdata/signature/issue63804.txt
diff --git a/gopls/internal/regtest/marker/testdata/signature/signature.txt b/gopls/internal/test/marker/testdata/signature/signature.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/signature/signature.txt
rename to gopls/internal/test/marker/testdata/signature/signature.txt
diff --git a/gopls/internal/regtest/marker/testdata/stubmethods/basic.txt b/gopls/internal/test/marker/testdata/stubmethods/basic.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/stubmethods/basic.txt
rename to gopls/internal/test/marker/testdata/stubmethods/basic.txt
diff --git a/gopls/internal/regtest/marker/testdata/stubmethods/issue61693.txt b/gopls/internal/test/marker/testdata/stubmethods/issue61693.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/stubmethods/issue61693.txt
rename to gopls/internal/test/marker/testdata/stubmethods/issue61693.txt
diff --git a/gopls/internal/regtest/marker/testdata/stubmethods/issue61830.txt b/gopls/internal/test/marker/testdata/stubmethods/issue61830.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/stubmethods/issue61830.txt
rename to gopls/internal/test/marker/testdata/stubmethods/issue61830.txt
diff --git a/gopls/internal/regtest/marker/testdata/suggestedfix/embeddirective.txt b/gopls/internal/test/marker/testdata/suggestedfix/embeddirective.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/suggestedfix/embeddirective.txt
rename to gopls/internal/test/marker/testdata/suggestedfix/embeddirective.txt
diff --git a/gopls/internal/regtest/marker/testdata/suggestedfix/missingfunction.txt b/gopls/internal/test/marker/testdata/suggestedfix/missingfunction.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/suggestedfix/missingfunction.txt
rename to gopls/internal/test/marker/testdata/suggestedfix/missingfunction.txt
diff --git a/gopls/internal/regtest/marker/testdata/suggestedfix/noresultvalues.txt b/gopls/internal/test/marker/testdata/suggestedfix/noresultvalues.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/suggestedfix/noresultvalues.txt
rename to gopls/internal/test/marker/testdata/suggestedfix/noresultvalues.txt
diff --git a/gopls/internal/regtest/marker/testdata/suggestedfix/self_assignment.txt b/gopls/internal/test/marker/testdata/suggestedfix/self_assignment.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/suggestedfix/self_assignment.txt
rename to gopls/internal/test/marker/testdata/suggestedfix/self_assignment.txt
diff --git a/gopls/internal/regtest/marker/testdata/suggestedfix/stub.txt b/gopls/internal/test/marker/testdata/suggestedfix/stub.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/suggestedfix/stub.txt
rename to gopls/internal/test/marker/testdata/suggestedfix/stub.txt
diff --git a/gopls/internal/regtest/marker/testdata/suggestedfix/undeclared.txt b/gopls/internal/test/marker/testdata/suggestedfix/undeclared.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/suggestedfix/undeclared.txt
rename to gopls/internal/test/marker/testdata/suggestedfix/undeclared.txt
diff --git a/gopls/internal/regtest/marker/testdata/suggestedfix/unusedrequire.txt b/gopls/internal/test/marker/testdata/suggestedfix/unusedrequire.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/suggestedfix/unusedrequire.txt
rename to gopls/internal/test/marker/testdata/suggestedfix/unusedrequire.txt
diff --git a/gopls/internal/regtest/marker/testdata/suggestedfix/unusedrequire_gowork.txt b/gopls/internal/test/marker/testdata/suggestedfix/unusedrequire_gowork.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/suggestedfix/unusedrequire_gowork.txt
rename to gopls/internal/test/marker/testdata/suggestedfix/unusedrequire_gowork.txt
diff --git a/gopls/internal/regtest/marker/testdata/symbol/basic.txt b/gopls/internal/test/marker/testdata/symbol/basic.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/symbol/basic.txt
rename to gopls/internal/test/marker/testdata/symbol/basic.txt
diff --git a/gopls/internal/regtest/marker/testdata/symbol/generic.txt b/gopls/internal/test/marker/testdata/symbol/generic.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/symbol/generic.txt
rename to gopls/internal/test/marker/testdata/symbol/generic.txt
diff --git a/gopls/internal/regtest/marker/testdata/token/range.txt b/gopls/internal/test/marker/testdata/token/range.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/token/range.txt
rename to gopls/internal/test/marker/testdata/token/range.txt
diff --git a/gopls/internal/regtest/marker/testdata/typedef/typedef.txt b/gopls/internal/test/marker/testdata/typedef/typedef.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/typedef/typedef.txt
rename to gopls/internal/test/marker/testdata/typedef/typedef.txt
diff --git a/gopls/internal/regtest/marker/testdata/workspacesymbol/allscope.txt b/gopls/internal/test/marker/testdata/workspacesymbol/allscope.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/workspacesymbol/allscope.txt
rename to gopls/internal/test/marker/testdata/workspacesymbol/allscope.txt
diff --git a/gopls/internal/regtest/marker/testdata/workspacesymbol/caseinsensitive.txt b/gopls/internal/test/marker/testdata/workspacesymbol/caseinsensitive.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/workspacesymbol/caseinsensitive.txt
rename to gopls/internal/test/marker/testdata/workspacesymbol/caseinsensitive.txt
diff --git a/gopls/internal/regtest/marker/testdata/workspacesymbol/casesensitive.txt b/gopls/internal/test/marker/testdata/workspacesymbol/casesensitive.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/workspacesymbol/casesensitive.txt
rename to gopls/internal/test/marker/testdata/workspacesymbol/casesensitive.txt
diff --git a/gopls/internal/regtest/marker/testdata/workspacesymbol/issue44806.txt b/gopls/internal/test/marker/testdata/workspacesymbol/issue44806.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/workspacesymbol/issue44806.txt
rename to gopls/internal/test/marker/testdata/workspacesymbol/issue44806.txt
diff --git a/gopls/internal/regtest/marker/testdata/workspacesymbol/workspacesymbol.txt b/gopls/internal/test/marker/testdata/workspacesymbol/workspacesymbol.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/workspacesymbol/workspacesymbol.txt
rename to gopls/internal/test/marker/testdata/workspacesymbol/workspacesymbol.txt
diff --git a/gopls/internal/regtest/marker/testdata/workspacesymbol/wsscope.txt b/gopls/internal/test/marker/testdata/workspacesymbol/wsscope.txt
similarity index 100%
rename from gopls/internal/regtest/marker/testdata/workspacesymbol/wsscope.txt
rename to gopls/internal/test/marker/testdata/workspacesymbol/wsscope.txt