formattester

package
v1.42.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAssetFormatTest

func RunAssetFormatTest(t *testing.T,
	pluginProvider pluginapitester.PluginProvider,
	assetProvider pluginapitester.AssetProvider,
	testBaseDir string,
	testCases []AssetTestCase,
)

RunAssetFormatTest tests the "format" operation using the provided asset. Resolves the format plugin using the provided locator and resolver, provides it with the asset and invokes the "format" command for the specified asset.

Types

type AssetTestCase

type AssetTestCase struct {
	Name        string
	Specs       []gofiles.GoFileSpec
	ConfigFiles map[string]string
	// Verify specifies whether or not formatter should be run in verify mode.
	Verify     bool
	Wd         string
	WantError  bool
	WantOutput func(projectDir string) string
	WantFiles  func(specFiles map[string]gofiles.GoFile) map[string]string
}

Jump to

Keyboard shortcuts

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