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

ExpectNotNil 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 FilePath Uses

func FilePath(file string) string

FilePath finds the absolute path of a file that is provided relative to the testdata directory of the current package under test.

func FindFacilityConfigFromWD Uses

func FindFacilityConfigFromWD() (string, error)

FindFacilityConfigFromWD finds the path of the folder containing the facility config based on the current working directory

Package test imports 7 packages (graph). Updated 2020-05-30. Refresh now. Tools for package owners.