ts

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package ts provides Go packages testing utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(t *testing.T, args ...interface{})

Error is equivalent to Log() followed by Fail().

func Errorf

func Errorf(t *testing.T, format string, args ...interface{})

Errorf is equivalent to Logf() followed by Fail().

func Fatal

func Fatal(t *testing.T, args ...interface{})

Fatal is equivalent to Log() followed by FailNow().

func Fatalf

func Fatalf(t *testing.T, format string, args ...interface{})

Fatalf is equivalent to Logf() followed by FailNow().

func Log

func Log(t *testing.T, args ...interface{})

Log formats its arguments using default formatting, analogous to Print(), and records the text in the error log.

func Logf

func Logf(t *testing.T, format string, args ...interface{})

Logf formats its arguments according to the format, analogous to Printf(), and records the text in the error log.

func PropVal added in v1.10.6

func PropVal(o reflect.Value, prop string) reflect.Value

PropVal returns property value of an object.

Types

type TestCase added in v1.10.6

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

TestCase represents a test case.

func (*TestCase) Call added in v1.10.6

func (p *TestCase) Call(fn interface{}, args ...interface{}) *TestCase

Call calls a function.

func (*TestCase) Equal added in v1.10.6

func (p *TestCase) Equal(v interface{}) *TestCase

Equal checks current output value.

func (*TestCase) PropEqual added in v1.10.6

func (p *TestCase) PropEqual(prop string, v interface{}) *TestCase

PropEqual checks property of current output value.

func (*TestCase) With added in v1.10.6

func (p *TestCase) With(i int) *TestCase

With set current output value to check.

type Testing added in v1.10.6

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

Testing represents a testing object.

func New added in v1.10.6

func New(t *testing.T) *Testing

New creates a testing object.

func (*Testing) Call added in v1.10.6

func (p *Testing) Call(fn interface{}, args ...interface{}) *TestCase

Call creates a test case, and then calls a function.

func (*Testing) Case added in v1.10.6

func (p *Testing) Case(name string) *TestCase

Case creates a test case.

Jump to

Keyboard shortcuts

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