Documentation
¶
Overview ¶
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 ¶
- func ExpectBool(t *testing.T, check, expected bool) bool
- func ExpectFloat(t *testing.T, check, expected float64) bool
- func ExpectInt(t *testing.T, check, expected int) bool
- func ExpectNil(t *testing.T, check interface{}) bool
- func ExpectNotNil(t *testing.T, check interface{}) bool
- func ExpectString(t *testing.T, check, expected string) bool
- func FilePath(file string) string
- func FindFacilityConfigFromWD() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpectBool ¶
ExpectBool stops a test and logs an error if the bool to be checked does not have the expected value.
func ExpectFloat ¶
ExpectFloat stops a test and logs an error if the float to be checked does not have the expected value.
func ExpectInt ¶
ExpectInt stops a test and logs an error if the int to be checked does not have the expected value.
func ExpectNotNil ¶
ExpectNotNil stops a test and logs an error if the value to check is nil
func ExpectString ¶
ExpectString stops a test and logs an error if the string to be checked does not have the expected value.
func FilePath ¶
FilePath finds the absolute path of a file that is provided relative to the testdata directory of the current package under test.
func FindFacilityConfigFromWD ¶ added in v2.2.0
FindFacilityConfigFromWD finds the path of the folder containing the facility config based on the current working directory
Types ¶
This section is empty.