Documentation ¶
Overview ¶
Package api is a collection of open source golang projects repurposed or simplified into goFish functions and/or packages
Assertions source code was taken from https://github.com/stretchr/testify/tree/master/assert
Assertions allow you to easily write test code, and are global funcs in the `assert` package. All assertion functions take, as the first argument, the `*testing.T` object provided by the testing framework. This allows the assertion funcs to write the failings and other details to the correct place.
Every assertion function also takes an optional string message as the final argument, allowing custom error messages to be appended to the message the assertion method outputs.
Sample storage-quickstart creates a Google Cloud Storage bucket.
Index ¶
- func CallerInfo() []string
- func Equal(t *testing.T, val1, val2 interface{})
- func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool
- func False(t TestingT, value bool, msgAndArgs ...interface{}) bool
- func InDelta(t TestingT, expected, actual interface{}, delta float64, ...) bool
- func Kernels()
- func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) bool
- func NewPool(size int) *ants.Pool
- func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool
- func NotEqual(t *testing.T, val1, val2 interface{})
- func NotNil(t *testing.T, w interface{})
- func OpenDirectory(dir string)
- func ScatterChart(filename string, x, y []float64)
- func True(t TestingT, value bool, msgAndArgs ...interface{}) bool
- type Bash
- type BoolAssertionFunc
- type Comparison
- type ComparisonAssertionFunc
- type Dumper
- type ErrorAssertionFunc
- type TestingT
- type ValueAssertionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallerInfo ¶
func CallerInfo() []string
CallerInfo returns an array of strings containing the file and line number of each stack frame leading from the current test to the assert call that failed.
func InDelta ¶
func InDelta(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool
InDelta asserts that the two numerals are within delta of each other.
InDelta(t, math.Pi, 22/7.0, 0.01)
func OpenDirectory ¶
func OpenDirectory(dir string)
func ScatterChart ¶
Types ¶
type Bash ¶
Bash struct implements the commander-cli/cmd which can be found at: https://github.com/commander-cli/cmd/blob/master/command.go
type BoolAssertionFunc ¶
BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful for table driven tests.
type Comparison ¶
type Comparison func() (success bool)
Comparison is a custom function that returns true on success and false on failure
type ComparisonAssertionFunc ¶
ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful for table driven tests.
type Dumper ¶
type ErrorAssertionFunc ¶
ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful for table driven tests.
type TestingT ¶
type TestingT interface {
Errorf(format string, args ...interface{})
}
TestingT is an interface wrapper around *testing.T
type ValueAssertionFunc ¶
ValueAssertionFunc is a common function prototype when validating a single value. Can be useful for table driven tests.