format

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColorlessPen = func(a ...interface{}) string {
	if a == nil || len(a) == 0 {
		return ""
	}
	items := make([]string, 0, len(a))
	for _, v := range a {
		s := fmt.Sprintf("%v", v)
		if len(s) > 0 {
			items = append(items, s)
		}
	}
	return strings.Join(items, " ")
}

Functions

This section is empty.

Types

type OutputPrinter

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

func NewOutputPrinter

func NewOutputPrinter(opts OutputPrinterOptions) (ref *OutputPrinter, err error)

func (*OutputPrinter) ContextInfo

func (w *OutputPrinter) ContextInfo(name string, message string, values ...string) string

func (*OutputPrinter) Cracked

func (w *OutputPrinter) Cracked(title string) string

func (*OutputPrinter) Failure

func (w *OutputPrinter) Failure(title string) string

func (*OutputPrinter) GetPen added in v1.0.6

func (w *OutputPrinter) GetPen(name PenType) Renderer

func (*OutputPrinter) GetWriter added in v1.0.8

func (w *OutputPrinter) GetWriter() io.Writer

func (*OutputPrinter) Heading

func (w *OutputPrinter) Heading(title string) string

func (*OutputPrinter) InfoMsg added in v1.0.6

func (w *OutputPrinter) InfoMsg(msg string) string

func (*OutputPrinter) IsColorized added in v1.0.6

func (w *OutputPrinter) IsColorized() bool

func (*OutputPrinter) NegativeTag added in v1.0.6

func (w *OutputPrinter) NegativeTag(tag string) string

func (*OutputPrinter) Pending added in v1.0.6

func (w *OutputPrinter) Pending(title string) string

func (*OutputPrinter) PositiveTag added in v1.0.6

func (w *OutputPrinter) PositiveTag(tag string) string

func (*OutputPrinter) Printf

func (w *OutputPrinter) Printf(format string, args ...interface{}) (n int, err error)

func (*OutputPrinter) Println

func (w *OutputPrinter) Println(a ...interface{}) (n int, err error)

func (*OutputPrinter) RegularTag added in v1.0.6

func (w *OutputPrinter) RegularTag(tag string) string

func (*OutputPrinter) Section

func (w *OutputPrinter) Section(block string) string

func (*OutputPrinter) SectionTitle

func (w *OutputPrinter) SectionTitle(title string) string

func (*OutputPrinter) SetWriter added in v1.0.8

func (w *OutputPrinter) SetWriter(writer io.Writer)

func (*OutputPrinter) Skipped

func (w *OutputPrinter) Skipped(title string) string

func (*OutputPrinter) Success

func (w *OutputPrinter) Success(title string) string

func (*OutputPrinter) TestCase

func (w *OutputPrinter) TestCase(title string) string

func (*OutputPrinter) TestSuiteTitle

func (w *OutputPrinter) TestSuiteTitle(filepath string) string

func (*OutputPrinter) WarnMsg added in v1.0.6

func (w *OutputPrinter) WarnMsg(msg string) string

type OutputPrinterOptions

type OutputPrinterOptions interface {
	GetNoColor() bool
}

type PenType added in v1.0.6

type PenType int
const (
	ContextNamePen PenType
	SectionTitlePen
	SectionBodyPen
	HeadingPen
	TestSuiteTitlePen
	TestCaseTitlePen
	PositiveTagPen
	NegativeTagPen
	RegularTagPen
	PendingPen
	SkippedPen
	SuccessPen
	FailurePen
	CrackedPen
)

type Renderer

type Renderer func(a ...interface{}) string

Jump to

Keyboard shortcuts

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