tests

package
v0.0.0-...-c039653 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2021 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExpectedCompletionsCount       = 121
	ExpectedCompletionSnippetCount = 14
	ExpectedDiagnosticsCount       = 17
	ExpectedFormatCount            = 5
	ExpectedImportCount            = 2
	ExpectedDefinitionsCount       = 35
	ExpectedTypeDefinitionsCount   = 2
	ExpectedHighlightsCount        = 2
	ExpectedSymbolsCount           = 1
	ExpectedSignaturesCount        = 20
	ExpectedLinksCount             = 2
)

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.

Variables

This section is empty.

Functions

func Run

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

Types

type CompletionItems

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

type CompletionSnippet

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

type CompletionSnippets

type CompletionSnippets map[span.Span]CompletionSnippet

type Completions

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

type Data

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
	Symbols            Symbols

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

func Load

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

func (*Data) Golden

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

type Definition

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

type Definitions

type Definitions map[span.Span]Definition

type Diagnostics

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

type Formats

type Formats []span.Span

type Golden

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

type Highlights

type Highlights map[string][]span.Span

type Imports

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

type Signatures

type Signatures map[span.Span]source.SignatureInformation

type Symbols

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

type SymbolsChildren

type SymbolsChildren map[string][]source.Symbol

type Tests

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)
	Symbol(*testing.T, Symbols)
	SignatureHelp(*testing.T, Signatures)
	Link(*testing.T, Links)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL