testing

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func MediaTypeEntries

func MediaTypeEntries() []ginkgo.TableEntry

func NewGitHubClient

func NewGitHubClient() *github.Client

Types

type Cache

type Cache struct{ cache.Directory }

func NewCache

func NewCache(fsys afero.Fs) *Cache

func NewCacheForT

func NewCacheForT(t *testing.T) *Cache

func (*Cache) Dir

func (c *Cache) Dir() string

type MockGenerator

type MockGenerator struct {
	ExecuteFunc func(*tdlv1alpha1.Spec, tdl.Sink) error
}

func NewMockGenerator

func NewMockGenerator() *MockGenerator

func (*MockGenerator) Execute

func (m *MockGenerator) Execute(spec *tdlv1alpha1.Spec, sink tdl.Sink) error

Execute implements tdl.Generator.

func (*MockGenerator) WithExecute

func (m *MockGenerator) WithExecute(
	fn func(*tdlv1alpha1.Spec, tdl.Sink) error,
) *MockGenerator

func (*MockGenerator) WithName

func (m *MockGenerator) WithName(name string) *MockGeneratorStringer

func (*MockGenerator) WithString

func (m *MockGenerator) WithString(
	fn func() string,
) *MockGeneratorStringer

type MockGeneratorStringer

type MockGeneratorStringer struct {
	*MockGenerator
	StringFunc func() string
}

type MockPlugin

type MockPlugin struct {
	GeneratorFunc func(tdl.Target) (tdl.Generator, error)
	StringFunc    func() string
}

func NewMockPlugin

func NewMockPlugin() *MockPlugin

func (*MockPlugin) Generator

func (m *MockPlugin) Generator(t tdl.Target) (tdl.Generator, error)

Generator implements tdl.Plugin.

func (*MockPlugin) String

func (m *MockPlugin) String() string

String implements tdl.Plugin.

func (*MockPlugin) WithGenerator

func (m *MockPlugin) WithGenerator(
	fn func(t tdl.Target) (tdl.Generator, error),
) *MockPlugin

func (*MockPlugin) WithString

func (m *MockPlugin) WithString(
	fn func() string,
) *MockPlugin

type MockTarget

type MockTarget struct {
	ChooseFunc  func([]tdl.Generator) (tdl.Generator, error)
	PluginsFunc func() iter.Seq[tdl.Plugin]
	StringFunc  func() string
}

func NewMockTarget

func NewMockTarget() *MockTarget

func (*MockTarget) Choose

func (m *MockTarget) Choose(available []tdl.Generator) (tdl.Generator, error)

Choose implements tdl.Target.

func (*MockTarget) Plugins

func (m *MockTarget) Plugins() iter.Seq[tdl.Plugin]

Plugins implements tdl.Target.

func (*MockTarget) String

func (m *MockTarget) String() string

String implements tdl.Target.

func (*MockTarget) WithChoose

func (m *MockTarget) WithChoose(
	fn func([]tdl.Generator) (tdl.Generator, error),
) *MockTarget

func (*MockTarget) WithPlugins

func (m *MockTarget) WithPlugins(
	fn func() iter.Seq[tdl.Plugin],
) *MockTarget

func (*MockTarget) WithString

func (m *MockTarget) WithString(
	fn func() string,
) *MockTarget

type Test

type Test struct {
	Name   string
	Input  []byte
	Output []byte
}

func Discover

func Discover(fsys afero.Fs, root string) ([]*Test, error)

func ReadTest

func ReadTest(fsys afero.Fs, root string) (*Test, error)

ReadTest attempts to read a valid Test from root. A valid test is defined as a directory that contains an input.* file and a output.* file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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