granitic: github.com/graniticio/granitic/test Index | Files

package test

import "github.com/graniticio/granitic/test"

Package test provides tools for Granitic's unit tests.

One of Granitic's design principles is that Granitic should not introduce dependencies on third-party libraries, so this package contains convenience methods for making Grantic's built-in unit tests more usable and readable that would be better served by a third-party test library.

These methods are not recommended for use in user applications or tests.

Index

Package Files

tools.go

func ExpectBool Uses

func ExpectBool(t *testing.T, check, expected bool) bool

ExpectBool stops a test and logs an error if the bool to be checked does not have the expected value.

func ExpectFloat Uses

func ExpectFloat(t *testing.T, check, expected float64) bool

ExpectFloat stops a test and logs an error if the float to be checked does not have the expected value.

func ExpectInt Uses

func ExpectInt(t *testing.T, check, expected int) bool

ExpectInt stops a test and logs an error if the int to be checked does not have the expected value.

func ExpectNil Uses

func ExpectNil(t *testing.T, check interface{}) bool

ExpectNil stops a test and logs an error if the value to check is not nil

func ExpectNotNil Uses

func ExpectNotNil(t *testing.T, check interface{}) bool

ExpectNil stops a test and logs an error if the value to check is nil

func ExpectString Uses

func ExpectString(t *testing.T, check, expected string) bool

ExpectString stops a test and logs an error if the string to be checked does not have the expected value.

func TestFilePath Uses

func TestFilePath(file string) string

TestFilePath finds the absolute path of a file that is provided relative to the resource/test directory.

Package test imports 8 packages (graph). Updated 2018-11-17. Refresh now. Tools for package owners.