test

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectBool

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

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

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

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

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

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

func TestFilePath(file string) string

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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