testutil

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixtureRoot

func FixtureRoot() string

FixtureRoot returns the path to the test fixtures directory

func LoadBasicTokens

func LoadBasicTokens(t *testing.T, server *lsp.Server)

LoadBasicTokens loads the basic-colors.json fixture into the server

func LoadCSSFixture

func LoadCSSFixture(t *testing.T, name string) string

LoadCSSFixture loads a CSS fixture file and returns the content

func LoadGoldenFile

func LoadGoldenFile(t *testing.T, name string) string

LoadGoldenFile loads a golden file for comparison

func LoadNonTokenFixture added in v0.1.18

func LoadNonTokenFixture(t *testing.T, name string) []byte

LoadNonTokenFixture loads a non-token file fixture and returns the bytes

func LoadTokenFixture

func LoadTokenFixture(t *testing.T, name string) []byte

LoadTokenFixture loads a token fixture file and returns the bytes

func LoadTokensWithPrefix

func LoadTokensWithPrefix(t *testing.T, server *lsp.Server, prefix string)

LoadTokensWithPrefix loads the with-prefix.json fixture into the server

func NewTestServer

func NewTestServer(t *testing.T) *lsp.Server

NewTestServer creates a new LSP server for testing

func OpenCSSFixture

func OpenCSSFixture(t *testing.T, server *lsp.Server, uri, fixtureName string)

OpenCSSFixture opens a CSS fixture file in the server

func OpenNonTokenFixture added in v0.1.18

func OpenNonTokenFixture(t *testing.T, server *lsp.Server, uri, fixtureName string)

OpenNonTokenFixture opens a non-token JSON/YAML fixture file as a document in the server This is for testing that LSP features are NOT provided for non-token files

func OpenTokenFixture

func OpenTokenFixture(t *testing.T, server *lsp.Server, uri, fixtureName string)

OpenTokenFixture opens a token fixture file as a document in the server This is useful for testing references/definition from token files

func SetCodeActionLiteralSupport added in v0.1.18

func SetCodeActionLiteralSupport(server *lsp.Server)

SetCodeActionLiteralSupport sets the client capabilities to support CodeAction literals. Call this before tests that use code actions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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