lab

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Perms = core.Permissions{
		File: 0o666,
		Dir:  0o777,
	}

	Static = struct {
		JSONFile        string
		JSONSubPath     string
		ElectricYouth   string
		NorthernCouncil string
		TeenageColor    string
		RetroWave       string
	}{
		JSONFile:        "resume-state.json",
		JSONSubPath:     "json/unmarshal/resume-state.json",
		ElectricYouth:   "Electric Youth",
		NorthernCouncil: "Northern Council",
		RetroWave:       "RETRO-WAVE",
		TeenageColor:    "Teenage Color",
	}
)
View Source
var (
	Reasons = struct {
		Node NamedFunc
	}{
		Node: func(name string) string {
			return fmt.Sprintf("❌ for node named: '%v'", name)
		},
	}
)

Functions

func AssertNavigation

func AssertNavigation(entry *NaviTE, to *TestOptions)

func Because

func Because(name, because string) string

func Begin

func Begin(em string) life.BeginHandler

func DirectoriesCallback

func DirectoriesCallback(name string) core.Client

func DirectoriesCaseSensitiveCallback

func DirectoriesCaseSensitiveCallback(first, second string) core.Client

func End

func End(em string) life.EndHandler

func FilesCallback

func FilesCallback(name string) core.Client

func GetJSONDir

func GetJSONDir() string

func GetJSONPath

func GetJSONPath() string

func HaveChildCountOf

func HaveChildCountOf(expected interface{}) GomegaMatcher

func HaveDirectoryContents

func HaveDirectoryContents(expected interface{}) GomegaMatcher

func HaveInvokedNode

func HaveInvokedNode(expected interface{}) GomegaMatcher

func HaveMetricCountOf

func HaveMetricCountOf(expected interface{}) GomegaMatcher

func HaveNotInvokedNode

func HaveNotInvokedNode(expected interface{}) GomegaMatcher

func IgnoreFault

func IgnoreFault(_ *pref.NavigationFault) error

func Normalise

func Normalise(p string) string

func PanicAt

func PanicAt(at string) core.Client

func Reason

func Reason(name string) string

func UniversalCallback

func UniversalCallback(name string) core.Client

Types

type ChildCountMatcher

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

func (*ChildCountMatcher) FailureMessage

func (m *ChildCountMatcher) FailureMessage(_ interface{}) string

func (*ChildCountMatcher) Match

func (m *ChildCountMatcher) Match(actual interface{}) (bool, error)

func (*ChildCountMatcher) NegatedFailureMessage

func (m *ChildCountMatcher) NegatedFailureMessage(_ interface{}) string

type DirectoryContentsMatcher

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

func (*DirectoryContentsMatcher) FailureMessage

func (m *DirectoryContentsMatcher) FailureMessage(_ interface{}) string

func (*DirectoryContentsMatcher) Match

func (m *DirectoryContentsMatcher) Match(actual interface{}) (bool, error)

func (*DirectoryContentsMatcher) NegatedFailureMessage

func (m *DirectoryContentsMatcher) NegatedFailureMessage(_ interface{}) string

type ExpectedCount

type ExpectedCount struct {
	Name  string
	Count int
}

type ExpectedMetric

type ExpectedMetric struct {
	Type  enums.Metric
	Count uint
}

type FilterErrataTE

type FilterErrataTE struct {
	NaviTE
	Filter *pref.FilterOptions
}

type FilterTE

type FilterTE struct {
	NaviTE
	Description     string
	Pattern         string
	Scope           enums.FilterScope
	Negate          bool
	ErrorContains   string
	IfNotApplicable enums.TriStateBool
	Custom          core.TraverseFilter
	Type            enums.FilterType
	Sample          core.SampleTraverseFilter
}

type HybridFilterTE

type HybridFilterTE struct {
	NaviTE
	NodeDef  core.FilterDef
	ChildDef core.ChildFilterDef
}

type InvokeNodeMatcher

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

func (*InvokeNodeMatcher) FailureMessage

func (m *InvokeNodeMatcher) FailureMessage(_ interface{}) string

func (*InvokeNodeMatcher) Match

func (m *InvokeNodeMatcher) Match(actual interface{}) (bool, error)

func (*InvokeNodeMatcher) NegatedFailureMessage

func (m *InvokeNodeMatcher) NegatedFailureMessage(_ interface{}) string

type MatcherExpectation

type MatcherExpectation[T comparable] struct {
	Expected T
	Actual   T
}

func (MatcherExpectation[T]) IsEqual

func (x MatcherExpectation[T]) IsEqual() bool

type MetricMatcher

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

func (*MetricMatcher) FailureMessage

func (m *MetricMatcher) FailureMessage(_ interface{}) string

func (*MetricMatcher) Match

func (m *MetricMatcher) Match(actual interface{}) (bool, error)

func (*MetricMatcher) NegatedFailureMessage

func (m *MetricMatcher) NegatedFailureMessage(_ interface{}) string

type NamedFunc

type NamedFunc func(name string) string
type NaviTE struct {
	Given         string
	Should        string
	Relative      string
	Once          bool
	Visit         bool
	CaseSensitive bool
	Subscription  enums.Subscription
	Callback      core.Client
	Mandatory     []string
	Prohibited    []string
	ByPassMetrics bool
	ExpectedNoOf  Quantities
	ExpectedErr   error
}

type NotInvokeNodeMatcher

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

func (*NotInvokeNodeMatcher) FailureMessage

func (m *NotInvokeNodeMatcher) FailureMessage(_ interface{}) string

func (*NotInvokeNodeMatcher) Match

func (m *NotInvokeNodeMatcher) Match(actual interface{}) (bool, error)

func (*NotInvokeNodeMatcher) NegatedFailureMessage

func (m *NotInvokeNodeMatcher) NegatedFailureMessage(_ interface{}) string

type PolyTE

type PolyTE struct {
	NaviTE
	File      core.FilterDef
	Directory core.FilterDef
}

type Quantities

type Quantities struct {
	Files       uint
	Directories uint
	Children    map[string]int
}

type Recall

type Recall map[string]int

type RecallOrder

type RecallOrder map[string]int

type RecallScope

type RecallScope map[string]enums.FilterScope

type SampleTE

type SampleTE struct {
	NaviTE
	SampleType enums.SampleType
	Reverse    bool
	Filter     *FilterTE
	NoOf       pref.EntryQuantities
	Each       pref.EachDirectoryEntryPredicate
	While      pref.WhileDirectoryPredicate
}

type TestOptions

type TestOptions struct {
	FS            *luna.MemFS
	Recording     Recall
	Path          string
	Result        core.TraverseResult
	Err           error
	ExpectedErr   error
	Every         func(p string) bool
	ByPassMetrics bool
}

type Trigger

type Trigger struct {
	Metrics core.Metrics
}

func (*Trigger) Times

func (t *Trigger) Times(m enums.Metric, n uint) *Trigger