tools: golang.org/x/tools/internal/lsp/tests Index | Files

package tests

import "golang.org/x/tools/internal/lsp/tests"

Index

Package Files

tests.go

Constants

const (
    ExpectedCompletionsCount       = 144
    ExpectedCompletionSnippetCount = 15
    ExpectedDiagnosticsCount       = 17
    ExpectedFormatCount            = 5
    ExpectedImportCount            = 2
    ExpectedDefinitionsCount       = 38
    ExpectedTypeDefinitionsCount   = 2
    ExpectedHighlightsCount        = 2
    ExpectedReferencesCount        = 5
    ExpectedRenamesCount           = 16
    ExpectedSymbolsCount           = 1
    ExpectedSignaturesCount        = 21
    ExpectedLinksCount             = 4
)

We hardcode the expected number of test cases to ensure that all tests are being executed. If a test is added, this number must be changed.

func Context Uses

func Context(t testing.TB) context.Context

func Run Uses

func Run(t *testing.T, tests Tests, data *Data)

type CompletionItems Uses

type CompletionItems map[token.Pos]*source.CompletionItem

type CompletionSnippet Uses

type CompletionSnippet struct {
    CompletionItem     token.Pos
    PlainSnippet       string
    PlaceholderSnippet string
}

type CompletionSnippets Uses

type CompletionSnippets map[span.Span]CompletionSnippet

type Completions Uses

type Completions map[span.Span][]token.Pos

type Data Uses

type Data struct {
    Config             packages.Config
    Exported           *packagestest.Exported
    Diagnostics        Diagnostics
    CompletionItems    CompletionItems
    Completions        Completions
    CompletionSnippets CompletionSnippets
    Formats            Formats
    Imports            Imports
    Definitions        Definitions
    Highlights         Highlights
    References         References
    Renames            Renames
    Symbols            Symbols

    Signatures Signatures
    Links      Links
    // contains filtered or unexported fields
}

func Load Uses

func Load(t testing.TB, exporter packagestest.Exporter, dir string) *Data

func (*Data) Golden Uses

func (data *Data) Golden(tag string, target string, update func() ([]byte, error)) []byte

type Definition Uses

type Definition struct {
    Name      string
    Src       span.Span
    IsType    bool
    OnlyHover bool
    Def       span.Span
}

type Definitions Uses

type Definitions map[span.Span]Definition

type Diagnostics Uses

type Diagnostics map[span.URI][]source.Diagnostic

type Formats Uses

type Formats []span.Span

type Golden Uses

type Golden struct {
    Filename string
    Archive  *txtar.Archive
    Modified bool
}

type Highlights Uses

type Highlights map[string][]span.Span

type Imports Uses

type Imports []span.Span
type Link struct {
    Src          span.Span
    Target       string
    NotePosition token.Position
}
type Links map[span.URI][]Link

type References Uses

type References map[span.Span][]span.Span

type Renames Uses

type Renames map[span.Span]string

type Signatures Uses

type Signatures map[span.Span]*source.SignatureInformation

type Symbols Uses

type Symbols map[span.URI][]source.Symbol

type SymbolsChildren Uses

type SymbolsChildren map[string][]source.Symbol

type Tests Uses

type Tests interface {
    Diagnostics(*testing.T, Diagnostics)
    Completion(*testing.T, Completions, CompletionSnippets, CompletionItems)
    Format(*testing.T, Formats)
    Import(*testing.T, Imports)
    Definition(*testing.T, Definitions)
    Highlight(*testing.T, Highlights)
    Reference(*testing.T, References)
    Rename(*testing.T, Renames)
    Symbol(*testing.T, Symbols)
    SignatureHelp(*testing.T, Signatures)
    Link(*testing.T, Links)
}

Package tests imports 15 packages (graph). Updated 2019-07-19. Refresh now. Tools for package owners.