annex

package module
v0.0.0-...-dc3d0b8 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 30 Imported by: 0

README

Annex Go SDK

Installation

go get github.com/annexsh/annex-sdk-go

Disclaimer

Annex is currently considered as a proof of concept and is not intended for serious use at this stage. Corners have purposefully been cut to allow for rapid development, which means major/breaking changes are to be expected.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCase

func RegisterCase(runner *TestSuiteRunner, caseFn func(t CaseT))

func RegisterInputCase

func RegisterInputCase[P any](runner *TestSuiteRunner, caseFn func(t CaseT, param P))

func RegisterInputTest

func RegisterInputTest[P any](runner *TestSuiteRunner, name string, test func(t TestT, param P))

func RegisterTest

func RegisterTest(runner *TestSuiteRunner, name string, test func(t TestT))

func RequireSuccess

func RequireSuccess(t TestT, pending *test.Pending)

func RequireSuccessResult

func RequireSuccessResult[R any](t TestT, pending *test.Pending) R

func SetResult

func SetResult(t CaseT, result any)

func StartCase

func StartCase(t TestT, caseFunc any, opts ...StartCaseOption) *test.Pending

Types

type CaseConfig

type CaseConfig struct {
	Case  any
	Input any
}

type CaseFunc

type CaseFunc func(ctx context.Context)

type CaseT

type CaseT interface {
	require.TestingT
	Context() context.Context
	Logger() testing.Logger
}

type InputCaseFunc

type InputCaseFunc[P any] func(t CaseT, param P)

type StartCaseOption

type StartCaseOption func(opts *startCaseOptions)

func WithInput

func WithInput(input any) StartCaseOption

type TestSuiteRunner

type TestSuiteRunner struct {
	// contains filtered or unexported fields
}

func NewTestSuiteRunner

func NewTestSuiteRunner(cfg TestSuiteRunnerConfig) (*TestSuiteRunner, error)

func (*TestSuiteRunner) Run

func (w *TestSuiteRunner) Run() error

type TestSuiteRunnerConfig

type TestSuiteRunnerConfig struct {
	HostPort      string
	Context       string
	TestSuiteName string
	TestSuiteDesc string     // optional
	Logger        log.Logger // optional
}

type TestT

type TestT interface {
	require.TestingT
	Logger() testing.Logger
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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