Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildError ¶
type BuildError struct { Package string `json:"package,omitempty"` Path string `json:"path,omitempty"` Line int64 `json:"line,omitempty"` Column int64 `json:"column,omitempty"` Have string `json:"have,omitempty"` Want string `json:"want,omitempty"` Message string `json:"message"` Raw string `json:"raw"` }
BuildError captures a single build error in a package
func (*BuildError) Excerpt ¶
func (line *BuildError) Excerpt() *Excerpt
Excerpt generates the data needed to display a code snippet of where a build error occurred
type Excerpt ¶
type Excerpt struct { Before *ExcerptLine Highlight *ExcerptHighlightLine After *ExcerptLine }
Excerpt is a generated structure that captures where an error happened
type ExcerptHighlightLine ¶
type ExcerptHighlightLine struct {
Line, Prefix, Highlight, Suffix string
}
ExcerptHighlightLine is the target of the excerpt
type ExcerptLine ¶
type ExcerptLine struct {
Line, Code string
}
ExcerptLine are lines around an excerpt
type Failure ¶
type Failure struct { Name string `json:"failure,omitempty"` Package string `json:"package,omitempty"` File string `json:"file,omitempty"` Line int `json:"line,omitempty"` Messages []string `json:"messages,omitempty"` Diff *TestifyDiff `json:"diff,omitempty"` IsPanic bool `json:"IsPanic,omitempty"` PanicTrace []PanicTraceLine `json:"panic_trace,omitempty"` // contains filtered or unexported fields }
Failure is a single test failure message
type Package ¶
type Package struct { Summary Name string `json:"name"` Tests map[string]*Test `json:"tests,omitempty"` State Action `json:"state"` Cached bool `json:"cached,omitempty"` StatementCount int64 `json:"statements,omitempty"` CoveredCount int64 `json:"covered,omitempty"` CoveragePercent float64 `json:"percent,omitempty"` // contains filtered or unexported fields }
Package is the test results for a single package
type PanicTraceLine ¶
type PanicTraceLine struct { Fn string `json:"fn,omitempty"` Line int `json:"line,omitempty"` Path string `json:"path,omitempty"` }
PanicTraceLine captues a single line in a panic trace that is within the project
type Set ¶
type Set struct { Name string TestSummary Summary `json:"test_summary"` PkgSummary Summary `json:"pkg_summary"` Cached int `json:"cached"` Packages map[string]*Package `json:"packages"` TotalTests int `json:"total_tests"` State Action `json:"state"` BuildErrors []*BuildError `json:"build_errors,omitempty"` StatementCount int64 `json:"statements,omitempty"` CoveredCount int64 `json:"covered,omitempty"` CoveragePercent float64 `json:"percent,omitempty"` FailedTests []*Test `json:"failed_tests,omitempty"` SkippedTests []*Test `json:"skipped_tests,omitempty"` SlowTests []*Test `json:"slow_tests,omitempty"` // contains filtered or unexported fields }
Set is the complete test results for all packages
func (*Set) Parse ¶
Parse will parse a reader line by line, adding the lines to the setult set. decor is a callback that can be used for displaying results
func (*Set) ParseError ¶
ParseError will try its best to parse an error message for formatting to the output, adding excerpts and diffs where possible
type Summary ¶
type Summary struct { Pass int `json:"pass,omitempty"` Fail int `json:"fail,omitempty"` Skip int `json:"skip,omitempty"` }
Summary Captuset to status of tests
type Test ¶
type Test struct { Name string `json:"name"` State Action `json:"state"` Package string `json:"package"` Failures []*Failure `json:"failures,omitempty"` // contains filtered or unexported fields }
Test is the results for a single test
type TestifyCompStructField ¶
type TestifyCompStructField struct { Name string `json:"name"` Correct bool `json:"correct"` Val *TestifyField `json:"val,omitempty"` Expected *TestifyField `json:"expected,omitempty"` Actual *TestifyField `json:"actual,omitempty"` }
TestifyCompStructField captures the state of a testify.compStruct
type TestifyDiff ¶
type TestifyDiff struct { Error string `json:"error"` Range string `json:"range"` Expected string `json:"expected"` Actual string `json:"actual"` Message string `json:"message"` Comp map[string]*TestifyCompStructField `json:"comp"` }
TestifyDiff captures testifys output after assert.Equal failts
type TestifyField ¶
type TestifyField struct { Type string `json:"type,omitempty"` Value string `json:"value,omitempty"` Length string `json:"length,omitempty"` }
TestifyField is one of the fields in a testify.compStruct expected or actual