architest

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AcceptanceTestFileRegex  = regexp.MustCompile("^.*_acceptance_test.go$")
	AcceptanceTestNameRegex  = regexp.MustCompile("^TestAcc_.+$")
	IntegrationTestFileRegex = regexp.MustCompile("^.*_integration_test.go$")
	IntegrationTestNameRegex = regexp.MustCompile("^TestInt_.+$")
	TestFileRegex            = regexp.MustCompile("^.*_test.go$")
	TestNameRegex            = regexp.MustCompile("^Test.*$")
)

Functions

This section is empty.

Types

type File

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

func NewFile

func NewFile(packageName string, fileName string, fileSrc *ast.File) *File

func NewFileFromPath

func NewFileFromPath(path string) *File

func (*File) AssertHasPackage

func (f *File) AssertHasPackage(t *testing.T, expectedPackage string)

func (*File) ExportedMethods

func (f *File) ExportedMethods() Methods

func (*File) Name

func (f *File) Name() string

func (*File) PackageName

func (f *File) PackageName() string

type FileFilter

type FileFilter = func(*File) bool

func FileNameFilterProvider

func FileNameFilterProvider(text string) FileFilter

func FileNameFilterWithExclusionsProvider

func FileNameFilterWithExclusionsProvider(regex *regexp.Regexp, exclusionRegex ...*regexp.Regexp) FileFilter

func FileNameRegexFilterProvider

func FileNameRegexFilterProvider(regex *regexp.Regexp) FileFilter

func PackageFilterProvider

func PackageFilterProvider(packageName string) FileFilter

type FileReceiver

type FileReceiver = func(*File)

type Files

type Files []File

func (Files) All

func (files Files) All(receiver FileReceiver)

func (Files) Filter

func (files Files) Filter(filter FileFilter) Files

type FilesProvider

type FilesProvider interface {
	AllFiles() Files
	Files(filter FileFilter) Files
}

func Directory

func Directory(path string) FilesProvider

type Method

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

func NewMethod

func NewMethod(name string, file *File) *Method

func (*Method) AssertAcceptanceTestNamedCorrectly

func (method *Method) AssertAcceptanceTestNamedCorrectly(t *testing.T)

func (*Method) AssertIntegrationTestNamedCorrectly

func (method *Method) AssertIntegrationTestNamedCorrectly(t *testing.T)

func (*Method) AssertNameDoesNotMatch

func (method *Method) AssertNameDoesNotMatch(t *testing.T, regex *regexp.Regexp)

func (*Method) AssertNameMatches

func (method *Method) AssertNameMatches(t *testing.T, regex *regexp.Regexp)

func (*Method) AssertTestNamedCorrectly

func (method *Method) AssertTestNamedCorrectly(t *testing.T)

func (*Method) FileName

func (method *Method) FileName() string

func (*Method) Name

func (method *Method) Name() string

type MethodReceiver

type MethodReceiver = func(method *Method)

type Methods

type Methods []Method

func (Methods) All

func (methods Methods) All(receiver MethodReceiver)

Jump to

Keyboard shortcuts

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