Documentation ¶
Overview ¶
Package reporting contains internal functionality related to console reporting and output. Although this package has exported names is not intended for public consumption. See the examples package for how to use this project.
Index ¶
- Constants
- func NewConsole() io.Writer
- func NewDotReporter(out *Printer) *dot
- func NewGoTestReporter() *gotestReporter
- func NewProblemReporter(out *Printer) *problem
- func NewReporters(collection ...Reporter) *reporters
- func NewSilentProblemReporter(out *Printer) *problem
- func NewStatisticsReporter(out *Printer) *statistics
- func NewStoryReporter(out *Printer) *story
- func PrintConsoleStatistics()
- func QuietMode()
- func SuppressConsoleStatistics()
- type AssertionResult
- type FailureView
- type JsonReporter
- func (self *JsonReporter) BeginStory(story *StoryReport)
- func (self *JsonReporter) EndStory()
- func (self *JsonReporter) Enter(scope *ScopeReport)
- func (self *JsonReporter) Exit()
- func (self *JsonReporter) Report(report *AssertionResult)
- func (self *JsonReporter) Write(content []byte) (written int, err error)
- type Printer
- type Reporter
- type ScopeReport
- type ScopeResult
- type StoryReport
- type T
Constants ¶
View Source
const CloseJson = "<-<-<-CLOSE-JSON<-<-<" // "⌫"
View Source
const OpenJson = ">->->OPEN-JSON->->->" // "⌦"
Variables ¶
This section is empty.
Functions ¶
func NewConsole ¶
func NewDotReporter ¶
func NewDotReporter(out *Printer) *dot
func NewGoTestReporter ¶
func NewGoTestReporter() *gotestReporter
func NewProblemReporter ¶
func NewProblemReporter(out *Printer) *problem
func NewReporters ¶
func NewReporters(collection ...Reporter) *reporters
func NewSilentProblemReporter ¶
func NewSilentProblemReporter(out *Printer) *problem
func NewStatisticsReporter ¶
func NewStatisticsReporter(out *Printer) *statistics
func NewStoryReporter ¶
func NewStoryReporter(out *Printer) *story
func PrintConsoleStatistics ¶
func PrintConsoleStatistics()
func QuietMode ¶
func QuietMode()
QuietMode disables all console output symbols. This is only meant to be used for tests that are internal to goconvey where the output is distracting or otherwise not needed in the test output.
func SuppressConsoleStatistics ¶
func SuppressConsoleStatistics()
Types ¶
type AssertionResult ¶
type AssertionResult struct { File string Line int Expected string Actual string Failure string Error any StackTrace string Skipped bool }
func NewErrorReport ¶
func NewErrorReport(err any) *AssertionResult
func NewFailureReport ¶
func NewFailureReport(failure string, showStack bool) *AssertionResult
func NewSkipReport ¶
func NewSkipReport() *AssertionResult
func NewSuccessReport ¶
func NewSuccessReport() *AssertionResult
type FailureView ¶
type FailureView struct { Message string `json:"Message"` Expected string `json:"Expected"` Actual string `json:"Actual"` }
FailureView is also declared in github.com/smarty/assertions. The json struct tags should be equal in both declarations.
type JsonReporter ¶
type JsonReporter struct {
// contains filtered or unexported fields
}
func NewJsonReporter ¶
func NewJsonReporter(out *Printer) *JsonReporter
func (*JsonReporter) BeginStory ¶
func (self *JsonReporter) BeginStory(story *StoryReport)
func (*JsonReporter) EndStory ¶
func (self *JsonReporter) EndStory()
func (*JsonReporter) Enter ¶
func (self *JsonReporter) Enter(scope *ScopeReport)
func (*JsonReporter) Exit ¶
func (self *JsonReporter) Exit()
func (*JsonReporter) Report ¶
func (self *JsonReporter) Report(report *AssertionResult)
type Reporter ¶
type Reporter interface { BeginStory(story *StoryReport) Enter(scope *ScopeReport) Report(r *AssertionResult) Exit() EndStory() io.Writer }
func BuildDotReporter ¶
func BuildDotReporter() Reporter
func BuildJsonReporter ¶
func BuildJsonReporter() Reporter
func BuildSilentReporter ¶
func BuildSilentReporter() Reporter
func BuildStoryReporter ¶
func BuildStoryReporter() Reporter
type ScopeReport ¶
func NewScopeReport ¶
func NewScopeReport(title string) *ScopeReport
type ScopeResult ¶
type StoryReport ¶
func NewStoryReport ¶
func NewStoryReport(test T) *StoryReport
Click to show internal directories.
Click to hide internal directories.