testza

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 14 Imported by: 2

README

testza 🍕

Testza is like pizza for Go - you could live without it, but why should you?

Latest Release Tests Coverage Unit test count Issues


Get The Module | Documentation | Contributing | Code of Conduct


Screenshot of an example test message

Installation

# Execute this command inside your project
go get github.com/MarvinJWendt/testza

Description

Testza is a full-featured testing framework for Go. It integrates with the default test runner, so you can use it with the standard go test tool. Testza contains easy to use methods, like assertions, output capturing, mocking, and much more.

The main goal of testza is to provide an easy and fun experience writing tests and providing a nice, user-friendly output. Even developers who never used testza, will get into it quickly.

Getting Started

Testza is very IDE friendly and was made to integrate with your IDE to increase your productivity.

// --- Some Examples ---

// - Some assertions -
testza.AssertTrue(t, true) // -> Pass
testza.AssertNoError(t, err) // -> Pass
testza.AssertEqual(t, object, object) // -> Pass
// ...

// - Testing console output -
// Test the output of your CLI tool easily!
terminalOutput, _ := testza.CaptureStdout(func(w io.Writer) error {fmt.Println("Hello"); return nil})
testza.AssertEqual(t, terminalOutput, "Hello\n") // -> Pass

// - Mocking -
// Testing a function that accepts email addresses as a parameter:

// Testset of many different email addresses
emailAddresses := testza.MockStringEmailAddresses()

// Run a test for every string in the test set
testza.MockStringRunTests(t, emailAddresses, func(t *testing.T, index int, str string) {
  user, domain, err := internal.ParseEmailAddress(str) // Use your function
  testza.AssertNoError(t, err) // Assert that your function does not return an error
  testza.AssertNotZero(t, user) // Assert that the user is returned
  testza.AssertNotZero(t, domain) // Assert that the domain is returned
})

// And that's just a few examples of what you can do with Testza!

Documentation

Module Methods
Assert
Click to expand
Capture
Click to expand
Mock Input Bool
Click to expand
Mock Input String
Click to expand
Mock Input Float64
Click to expand
Mock Input Int
Click to expand

Assert

AssertCompletesIn
func AssertCompletesIn(t testRunner, duration time.Duration, f func(), msg ...interface{})

AssertCompletesIn asserts that a function completes in a given time. Use this function to test that functions do not take too long to complete.

NOTE: Every system takes a different amount of time to complete a function. Do not set the duration too low, if you want consistent results.

AssertContains
func AssertContains(t testRunner, object, element interface{}, msg ...interface{})

AssertContains asserts that a string/list/array/slice/map contains the specified element.

AssertEqual
func AssertEqual(t testRunner, expected interface{}, actual interface{}, msg ...interface{})

AssertEqual asserts that two objects are equal.

AssertEqualValues
func AssertEqualValues(t testRunner, expected interface{}, actual interface{}, msg ...interface{})

AssertEqualValues asserts that two objects have equal values.

AssertFalse
func AssertFalse(t testRunner, value interface{}, msg ...interface{})

AssertFalse asserts that an expression or object resolves to false.

AssertGreater
func AssertGreater(t testRunner, object1, object2 interface{}, msg ...interface{})

AssertGreater asserts that the first object is greater than the second.

AssertImplements
func AssertImplements(t testRunner, interfaceObject, object interface{}, msg ...interface{})

AssertImplements asserts that an objects implements an interface.

testza.AssertImplements(t, (*YourInterface)(nil), new(YourObject))
testza.AssertImplements(t, (*fmt.Stringer)(nil), new(types.Const)) => pass
AssertKindOf
func AssertKindOf(t testRunner, expectedKind reflect.Kind, object interface{}, msg ...interface{})

AssertKindOf asserts that the object is a type of kind exptectedKind.

AssertLess
func AssertLess(t testRunner, object1, object2 interface{}, msg ...interface{})

AssertLess asserts that the first object is less than the second.

AssertNil
func AssertNil(t testRunner, object interface{}, msg ...interface{})

AssertNil asserts that an object is nil.

AssertNoError
func AssertNoError(t testRunner, err interface{}, msg ...interface{})

AssertNoError asserts that an error is nil.

AssertNotCompletesIn
func AssertNotCompletesIn(t testRunner, duration time.Duration, f func(), msg ...interface{})

AssertNotCompletesIn asserts that a function does not complete in a given time. Use this function to test that functions do not complete to quickly. For example if your database connection completes in under a millisecond, there might be something wrong.

NOTE: Every system takes a different amount of time to complete a function. Do not set the duration too high, if you want consistent results.

AssertNotContains
func AssertNotContains(t testRunner, object, element interface{}, msg ...interface{})

AssertNotContains asserts that a string/list/array/slice/map does not contain the specified element.

AssertNotEqual
func AssertNotEqual(t testRunner, expected interface{}, actual interface{}, msg ...interface{})

AssertNotEqual asserts that two objects are not equal.

AssertNotEqualValues
func AssertNotEqualValues(t testRunner, expected interface{}, actual interface{}, msg ...interface{})

AssertNotEqualValues asserts that two objects do not have equal values.

AssertNotImplements
func AssertNotImplements(t testRunner, interfaceObject, object interface{}, msg ...interface{})

AssertNotImplements asserts that an object does not implement an interface.

testza.AssertNotImplements(t, (*YourInterface)(nil), new(YourObject))
testza.AssertNotImplements(t, (*fmt.Stringer)(nil), new(types.Const)) => fail, because types.Const does implement fmt.Stringer.
AssertNotKindOf
func AssertNotKindOf(t testRunner, kind reflect.Kind, object interface{}, msg ...interface{})

AssertNotKindOf asserts that the object is not a type of kind kind.

AssertNotNil
func AssertNotNil(t testRunner, object interface{}, msg ...interface{})

AssertNotNil asserts that an object is not nil.

AssertNotNumeric
func AssertNotNumeric(t testRunner, object interface{}, msg ...interface{})

AssertNotNumeric checks if the object is not a numeric type. Numeric types are: Int, Int8, Int16, Int32, Int64, Float32, Float64, Uint, Uint8, Uint16, Uint32, Uint64, Complex64 and Complex128.

AssertNotPanic
func AssertNotPanic(t testRunner, f func(), msg ...interface{})

AssertNotPanic asserts that a function does not panic.

AssertNotZero
func AssertNotZero(t testRunner, value interface{}, msg ...interface{})

AssertNotZero asserts that the value is not the zero value for it's type.

testza.AssertNotZero(t, 1337)
testza.AssertNotZero(t, true)
testza.AssertNotZero(t, "Hello, World")
AssertNumeric
func AssertNumeric(t testRunner, object interface{}, msg ...interface{})

AssertNumeric asserts that the object is a numeric type. Numeric types are: Int, Int8, Int16, Int32, Int64, Float32, Float64, Uint, Uint8, Uint16, Uint32, Uint64, Complex64 and Complex128.

AssertPanic
func AssertPanic(t testRunner, f func(), msg ...interface{})

AssertPanic asserts that a function panics.

AssertTrue
func AssertTrue(t testRunner, value interface{}, msg ...interface{})

AssertTrue asserts that an expression or object resolves to true.

AssertZero
func AssertZero(t testRunner, value interface{}, msg ...interface{})

AssertZero asserts that the value is the zero value for it's type.

testza.AssertZero(t, 0)
testza.AssertZero(t, false)
testza.AssertZero(t, "")

Capture

CaptureStderr
func CaptureStderr(capture func(w io.Writer) error) (string, error)

CaptureStderr captures everything written to stderr from a specific function. You can use this method in tests, to validate that your functions writes a string to the terminal.

CaptureStdout
func CaptureStdout(capture func(w io.Writer) error) (string, error)

CaptureStdout captures everything written to stdout from a specific function. You can use this method in tests, to validate that your functions writes a string to the terminal.

Mock Input Bool

MockInputBoolFull
func MockInputBoolFull() []bool

MockInputBoolFull returns true and false in a boolean slice.

MockInputBoolModify
func MockInputBoolModify(inputSlice []bool, f func(index int, value bool) bool) (floats []bool)

MockInputBoolModify returns a modified version of a test set.

MockInputBoolRunTests
func MockInputBoolRunTests(t testRunner, testSet []bool, testFunc func(t *testing.T, index int, f bool))

MockInputBoolRunTests runs a test for every value in a testset. You can use the value as input parameter for your functions, to sanity test against many different cases. This ensures that your functions have a correct error handling and enables you to test against hunderts of cases easily.

Mock Input Float64

MockInputFloat64Full
func MockInputFloat64Full() (floats []float64)

MockInputFloat64Full returns a combination of every float64 testset and some random float64s (positive and negative).

MockInputFloat64GenerateRandomNegative
func MockInputFloat64GenerateRandomNegative(count int, min float64) (floats []float64)

MockInputFloat64GenerateRandomNegative generates random negative integers with a minimum of min. If the minimum is positive, it will be converted to a negative number. If it is set to 0, there is no limit.

MockInputFloat64GenerateRandomPositive
func MockInputFloat64GenerateRandomPositive(count int, max float64) (floats []float64)

MockInputFloat64GenerateRandomPositive generates random positive integers with a maximum of max. If the maximum is 0, or below, the maximum will be set to math.MaxInt64.

MockInputFloat64GenerateRandomRange
func MockInputFloat64GenerateRandomRange(count int, min, max float64) (floats []float64)

MockInputFloat64GenerateRandomRange generates random positive integers with a maximum of max. If the maximum is 0, or below, the maximum will be set to math.MaxInt64.

MockInputFloat64Modify
func MockInputFloat64Modify(inputSlice []float64, f func(index int, value float64) float64) (floats []float64)

MockInputFloat64Modify returns a modified version of a test set.

MockInputFloat64RunTests
func MockInputFloat64RunTests(t testRunner, testSet []float64, testFunc func(t *testing.T, index int, f float64))

MockInputFloat64RunTests runs a test for every value in a testset. You can use the value as input parameter for your functions, to sanity test against many different cases. This ensures that your functions have a correct error handling and enables you to test against hunderts of cases easily.

Mock Input Int

MockInputIntFull
func MockInputIntFull() (ints []int)

MockInputIntFull returns a combination of every integer testset and some random integers (positive and negative).

MockInputIntGenerateRandomNegative
func MockInputIntGenerateRandomNegative(count, min int) (ints []int)

MockInputIntGenerateRandomNegative generates random negative integers with a minimum of min. If the minimum is 0, or above, the maximum will be set to math.MinInt64.

MockInputIntGenerateRandomPositive
func MockInputIntGenerateRandomPositive(count, max int) (ints []int)

MockInputIntGenerateRandomPositive generates random positive integers with a maximum of max. If the maximum is 0, or below, the maximum will be set to math.MaxInt64.

MockInputIntGenerateRandomRange
func MockInputIntGenerateRandomRange(count, min, max int) (ints []int)

MockInputIntGenerateRandomRange generates random integers with a range of min to max.

MockInputIntModify
func MockInputIntModify(inputSlice []int, f func(index int, value int) int) (ints []int)

MockInputIntModify returns a modified version of a test set.

MockInputIntRunTests
func MockInputIntRunTests(t testRunner, testSet []int, testFunc func(t *testing.T, index int, i int))

MockInputIntRunTests runs a test for every value in a testset. You can use the value as input parameter for your functions, to sanity test against many different cases. This ensures that your functions have a correct error handling and enables you to test against hunderts of cases easily.

Mock Input String

MockInputStringEmailAddresses
func MockInputStringEmailAddresses() []string

MockInputStringEmailAddresses returns a test set with valid email addresses.

MockInputStringEmpty
func MockInputStringEmpty() []string

MockInputStringEmpty returns a test set with a single empty string.

MockInputStringFull
func MockInputStringFull() (ret []string)

MockInputStringFull contains all string test sets plus ten generated random strings.

MockInputStringGenerateRandom
func MockInputStringGenerateRandom(count, length int) (result []string)

MockInputStringGenerateRandom returns random StringsHelper in a test set.

MockInputStringHtmlTags
func MockInputStringHtmlTags() []string

MockInputStringHtmlTags returns a test set with html tags.

MockInputStringLimit
func MockInputStringLimit(testSet []string, max int) []string

MockInputStringLimit limits a test set in size.

MockInputStringLong
func MockInputStringLong() (testSet []string)

MockInputStringLong returns a test set with long random strings. Returns: - Random string (length: 25) - Random string (length: 50) - Random string (length: 100) - Random string (length: 1,000) - Random string (length: 100,000)

MockInputStringModify
func MockInputStringModify(inputSlice []string, f func(index int, value string) string) (ret []string)

MockInputStringModify returns a modified version of a test set.

MockInputStringNumeric
func MockInputStringNumeric() []string

MockInputStringNumeric returns a test set with strings that are numeric. The highest number in here is "9223372036854775807", which is equal to the maxmim int64.

MockInputStringRunTests
func MockInputStringRunTests(t testRunner, testSet []string, testFunc func(t *testing.T, index int, str string))

MockInputStringRunTests runs a test for every value in a testset. You can use the value as input parameter for your functions, to sanity test against many different cases. This ensures that your functions have a correct error handling and enables you to test against hunderts of cases easily.


Made with ❤️ by @MarvinJWendt and contributors! | MarvinJWendt.com

Documentation

Overview

Package testza is a full-featured testing framework for Go. It integrates with the default test runner, so you can use it with the standard `go test` tool. Testza contains easy to use methods, like assertions, output capturing, mocking, and much more.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertCompletesIn added in v0.1.0

func AssertCompletesIn(t testRunner, duration time.Duration, f func(), msg ...interface{})

AssertCompletesIn asserts that a function completes in a given time. Use this function to test that functions do not take too long to complete.

NOTE: Every system takes a different amount of time to complete a function. Do not set the duration too low, if you want consistent results.

func AssertContains added in v0.1.0

func AssertContains(t testRunner, object, element interface{}, msg ...interface{})

AssertContains asserts that a string/list/array/slice/map contains the specified element.

func AssertEqual added in v0.1.0

func AssertEqual(t testRunner, expected interface{}, actual interface{}, msg ...interface{})

AssertEqual asserts that two objects are equal.

func AssertEqualValues added in v0.1.0

func AssertEqualValues(t testRunner, expected interface{}, actual interface{}, msg ...interface{})

AssertEqualValues asserts that two objects have equal values.

func AssertFalse added in v0.1.0

func AssertFalse(t testRunner, value interface{}, msg ...interface{})

AssertFalse asserts that an expression or object resolves to false.

func AssertGreater added in v0.1.0

func AssertGreater(t testRunner, object1, object2 interface{}, msg ...interface{})

AssertGreater asserts that the first object is greater than the second.

func AssertImplements added in v0.1.0

func AssertImplements(t testRunner, interfaceObject, object interface{}, msg ...interface{})

AssertImplements asserts that an objects implements an interface.

testza.AssertImplements(t, (*YourInterface)(nil), new(YourObject))
testza.AssertImplements(t, (*fmt.Stringer)(nil), new(types.Const)) => pass

func AssertKindOf added in v0.1.0

func AssertKindOf(t testRunner, expectedKind reflect.Kind, object interface{}, msg ...interface{})

AssertKindOf asserts that the object is a type of kind exptectedKind.

func AssertLess added in v0.1.0

func AssertLess(t testRunner, object1, object2 interface{}, msg ...interface{})

AssertLess asserts that the first object is less than the second.

func AssertNil added in v0.1.0

func AssertNil(t testRunner, object interface{}, msg ...interface{})

AssertNil asserts that an object is nil.

func AssertNoError added in v0.1.0

func AssertNoError(t testRunner, err interface{}, msg ...interface{})

AssertNoError asserts that an error is nil.

func AssertNotCompletesIn added in v0.1.0

func AssertNotCompletesIn(t testRunner, duration time.Duration, f func(), msg ...interface{})

AssertNotCompletesIn asserts that a function does not complete in a given time. Use this function to test that functions do not complete to quickly. For example if your database connection completes in under a millisecond, there might be something wrong.

NOTE: Every system takes a different amount of time to complete a function. Do not set the duration too high, if you want consistent results.

func AssertNotContains added in v0.1.0

func AssertNotContains(t testRunner, object, element interface{}, msg ...interface{})

AssertNotContains asserts that a string/list/array/slice/map does not contain the specified element.

func AssertNotEqual added in v0.1.0

func AssertNotEqual(t testRunner, expected interface{}, actual interface{}, msg ...interface{})

AssertNotEqual asserts that two objects are not equal.

func AssertNotEqualValues added in v0.1.0

func AssertNotEqualValues(t testRunner, expected interface{}, actual interface{}, msg ...interface{})

AssertNotEqualValues asserts that two objects do not have equal values.

func AssertNotImplements added in v0.1.0

func AssertNotImplements(t testRunner, interfaceObject, object interface{}, msg ...interface{})

AssertNotImplements asserts that an object does not implement an interface.

testza.AssertNotImplements(t, (*YourInterface)(nil), new(YourObject))
testza.AssertNotImplements(t, (*fmt.Stringer)(nil), new(types.Const)) => fail, because types.Const does implement fmt.Stringer.

func AssertNotKindOf added in v0.1.0

func AssertNotKindOf(t testRunner, kind reflect.Kind, object interface{}, msg ...interface{})

AssertNotKindOf asserts that the object is not a type of kind `kind`.

func AssertNotNil added in v0.1.0

func AssertNotNil(t testRunner, object interface{}, msg ...interface{})

AssertNotNil asserts that an object is not nil.

func AssertNotNumeric added in v0.1.0

func AssertNotNumeric(t testRunner, object interface{}, msg ...interface{})

AssertNotNumeric checks if the object is not a numeric type. Numeric types are: Int, Int8, Int16, Int32, Int64, Float32, Float64, Uint, Uint8, Uint16, Uint32, Uint64, Complex64 and Complex128.

func AssertNotPanic added in v0.1.0

func AssertNotPanic(t testRunner, f func(), msg ...interface{})

AssertNotPanic asserts that a function does not panic.

func AssertNotZero added in v0.1.0

func AssertNotZero(t testRunner, value interface{}, msg ...interface{})

AssertNotZero asserts that the value is not the zero value for it's type.

testza.AssertNotZero(t, 1337)
testza.AssertNotZero(t, true)
testza.AssertNotZero(t, "Hello, World")

func AssertNumeric added in v0.1.0

func AssertNumeric(t testRunner, object interface{}, msg ...interface{})

AssertNumeric asserts that the object is a numeric type. Numeric types are: Int, Int8, Int16, Int32, Int64, Float32, Float64, Uint, Uint8, Uint16, Uint32, Uint64, Complex64 and Complex128.

func AssertPanic added in v0.1.0

func AssertPanic(t testRunner, f func(), msg ...interface{})

AssertPanic asserts that a function panics.

func AssertTrue added in v0.1.0

func AssertTrue(t testRunner, value interface{}, msg ...interface{})

AssertTrue asserts that an expression or object resolves to true.

func AssertZero added in v0.1.0

func AssertZero(t testRunner, value interface{}, msg ...interface{})

AssertZero asserts that the value is the zero value for it's type.

testza.AssertZero(t, 0)
testza.AssertZero(t, false)
testza.AssertZero(t, "")

func CaptureStderr added in v0.1.0

func CaptureStderr(capture func(w io.Writer) error) (string, error)

CaptureStderr captures everything written to stderr from a specific function. You can use this method in tests, to validate that your functions writes a string to the terminal.

func CaptureStdout added in v0.1.0

func CaptureStdout(capture func(w io.Writer) error) (string, error)

CaptureStdout captures everything written to stdout from a specific function. You can use this method in tests, to validate that your functions writes a string to the terminal.

func MockInputBoolFull added in v0.1.0

func MockInputBoolFull() []bool

MockInputBoolFull returns true and false in a boolean slice.

func MockInputBoolModify added in v0.1.0

func MockInputBoolModify(inputSlice []bool, f func(index int, value bool) bool) (floats []bool)

MockInputBoolModify returns a modified version of a test set.

func MockInputBoolRunTests added in v0.1.0

func MockInputBoolRunTests(t testRunner, testSet []bool, testFunc func(t *testing.T, index int, f bool))

MockInputBoolRunTests runs a test for every value in a testset. You can use the value as input parameter for your functions, to sanity test against many different cases. This ensures that your functions have a correct error handling and enables you to test against hunderts of cases easily.

func MockInputFloat64Full added in v0.1.0

func MockInputFloat64Full() (floats []float64)

MockInputFloat64Full returns a combination of every float64 testset and some random float64s (positive and negative).

func MockInputFloat64GenerateRandomNegative added in v0.1.0

func MockInputFloat64GenerateRandomNegative(count int, min float64) (floats []float64)

MockInputFloat64GenerateRandomNegative generates random negative integers with a minimum of min. If the minimum is positive, it will be converted to a negative number. If it is set to 0, there is no limit.

func MockInputFloat64GenerateRandomPositive added in v0.1.0

func MockInputFloat64GenerateRandomPositive(count int, max float64) (floats []float64)

MockInputFloat64GenerateRandomPositive generates random positive integers with a maximum of max. If the maximum is 0, or below, the maximum will be set to math.MaxInt64.

func MockInputFloat64GenerateRandomRange added in v0.1.0

func MockInputFloat64GenerateRandomRange(count int, min, max float64) (floats []float64)

MockInputFloat64GenerateRandomRange generates random positive integers with a maximum of max. If the maximum is 0, or below, the maximum will be set to math.MaxInt64.

func MockInputFloat64Modify added in v0.1.0

func MockInputFloat64Modify(inputSlice []float64, f func(index int, value float64) float64) (floats []float64)

MockInputFloat64Modify returns a modified version of a test set.

func MockInputFloat64RunTests added in v0.1.0

func MockInputFloat64RunTests(t testRunner, testSet []float64, testFunc func(t *testing.T, index int, f float64))

MockInputFloat64RunTests runs a test for every value in a testset. You can use the value as input parameter for your functions, to sanity test against many different cases. This ensures that your functions have a correct error handling and enables you to test against hunderts of cases easily.

func MockInputIntFull added in v0.1.0

func MockInputIntFull() (ints []int)

MockInputIntFull returns a combination of every integer testset and some random integers (positive and negative).

func MockInputIntGenerateRandomNegative added in v0.1.0

func MockInputIntGenerateRandomNegative(count, min int) (ints []int)

MockInputIntGenerateRandomNegative generates random negative integers with a minimum of min. If the minimum is 0, or above, the maximum will be set to math.MinInt64.

func MockInputIntGenerateRandomPositive added in v0.1.0

func MockInputIntGenerateRandomPositive(count, max int) (ints []int)

MockInputIntGenerateRandomPositive generates random positive integers with a maximum of max. If the maximum is 0, or below, the maximum will be set to math.MaxInt64.

func MockInputIntGenerateRandomRange added in v0.1.0

func MockInputIntGenerateRandomRange(count, min, max int) (ints []int)

MockInputIntGenerateRandomRange generates random integers with a range of min to max.

func MockInputIntModify added in v0.1.0

func MockInputIntModify(inputSlice []int, f func(index int, value int) int) (ints []int)

MockInputIntModify returns a modified version of a test set.

func MockInputIntRunTests added in v0.1.0

func MockInputIntRunTests(t testRunner, testSet []int, testFunc func(t *testing.T, index int, i int))

MockInputIntRunTests runs a test for every value in a testset. You can use the value as input parameter for your functions, to sanity test against many different cases. This ensures that your functions have a correct error handling and enables you to test against hunderts of cases easily.

func MockInputStringEmailAddresses added in v0.1.0

func MockInputStringEmailAddresses() []string

MockInputStringEmailAddresses returns a test set with valid email addresses.

func MockInputStringEmpty added in v0.1.0

func MockInputStringEmpty() []string

MockInputStringEmpty returns a test set with a single empty string.

func MockInputStringFull added in v0.1.0

func MockInputStringFull() (ret []string)

MockInputStringFull contains all string test sets plus ten generated random strings.

func MockInputStringGenerateRandom added in v0.1.0

func MockInputStringGenerateRandom(count, length int) (result []string)

MockInputStringGenerateRandom returns random StringsHelper in a test set.

func MockInputStringHtmlTags added in v0.1.0

func MockInputStringHtmlTags() []string

MockInputStringHtmlTags returns a test set with html tags.

func MockInputStringLimit added in v0.1.0

func MockInputStringLimit(testSet []string, max int) []string

MockInputStringLimit limits a test set in size.

func MockInputStringLong added in v0.1.0

func MockInputStringLong() (testSet []string)

MockInputStringLong returns a test set with long random strings. Returns: - Random string (length: 25) - Random string (length: 50) - Random string (length: 100) - Random string (length: 1,000) - Random string (length: 100,000)

func MockInputStringModify added in v0.1.0

func MockInputStringModify(inputSlice []string, f func(index int, value string) string) (ret []string)

MockInputStringModify returns a modified version of a test set.

func MockInputStringNumeric added in v0.1.0

func MockInputStringNumeric() []string

MockInputStringNumeric returns a test set with strings that are numeric. The highest number in here is "9223372036854775807", which is equal to the maxmim int64.

func MockInputStringRunTests added in v0.1.0

func MockInputStringRunTests(t testRunner, testSet []string, testFunc func(t *testing.T, index int, str string))

MockInputStringRunTests runs a test for every value in a testset. You can use the value as input parameter for your functions, to sanity test against many different cases. This ensures that your functions have a correct error handling and enables you to test against hunderts of cases easily.

func MockInputStringUsernames added in v0.1.0

func MockInputStringUsernames() []string

MockInputStringUsernames returns a test set with usernames.

Types

This section is empty.

Directories

Path Synopsis
Custom CI-System for https://github.com/MarvinJWendt/testza.
Custom CI-System for https://github.com/MarvinJWendt/testza.

Jump to

Keyboard shortcuts

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