Documentation ¶
Index ¶
- Constants
- type Function
- func (f *Function) Comment() string
- func (f *Function) HasAfterTestAnnotation() bool
- func (f *Function) HasBeforeTestAnnotation() bool
- func (f *Function) HasFixtureAnnotation() bool
- func (f *Function) HasOnceFixtureAnnotation() bool
- func (f *Function) HasTestAnnotation() bool
- func (f *Function) Name() string
- func (f *Function) String() string
- type LabelFunction
- type ParseResult
Constants ¶
View Source
const ( // FixtureAnnotation used to label a function as a fixture FixtureAnnotation = "@fixture" // OnceFixtureAnnotation used to label a function as a fixture to be called once OnceFixtureAnnotation = "@onceFixture" // TestAnnotation used to label a function as a test TestAnnotation = "@test" // BeforeTestAnnotation used to label a function as a before test hook BeforeTestAnnotation = "@beforeTest" // AfterTestAnnotation used to label a function as a after test hook AfterTestAnnotation = "@afterTest" // TestLabelAnnotation used to introduce a new test Label. TestLabelAnnotation = "@testLabel" // DisableAutoLabellingAnnotation can be used to toggle the auto matching of tests. DisableAutoLabellingAnnotation = "@disableAutoLabelling" DefaultTestLabel = unitTestLabel )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Function ¶
Function represents a function declaration.
func (*Function) HasAfterTestAnnotation ¶
HasAfterTestAnnotation returns true if the function has a afterTest annotation.
func (*Function) HasBeforeTestAnnotation ¶
HasBeforeTestAnnotation returns true if the function has a beforeTest annotation.
func (*Function) HasFixtureAnnotation ¶
HasFixtureAnnotation returns true if the function has a fixture annotation.
func (*Function) HasOnceFixtureAnnotation ¶
HasOnceFixtureAnnotation returns true if the function has a onceFixture annotation.
func (*Function) HasTestAnnotation ¶
HasTestAnnotation returns true if the function has a test annotation.
type LabelFunction ¶
type ParseResult ¶
type ParseResult struct { Package *ast.Package DefaultTestLabel string // Label name => prefix. TestLabels map[string][]string Fixtures []*Function OnceFixtures []*Function Tests []*LabelFunction BeforeTests []*Function AfterTests []*Function Warnings []string }
ParseResult holds the package and functions parsed.
Click to show internal directories.
Click to hide internal directories.