gtest

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gtest provides convenient test utils for unit testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(value, expect interface{})

Assert checks <value> and <expect> EQUAL.

func AssertEQ

func AssertEQ(value, expect interface{})

AssertEQ checks <value> and <expect> EQUAL, including their TYPES.

func AssertGT

func AssertGT(value, expect interface{})

AssertGT checks <value> is GREATER THAN <expect>. Notice that, only string, integer and float types can be compared by AssertGT, others are invalid.

func AssertGTE

func AssertGTE(value, expect interface{})

AssertGTE checks <value> is GREATER OR EQUAL THAN <expect>. Notice that, only string, integer and float types can be compared by AssertGTE, others are invalid.

func AssertIN

func AssertIN(value, expect interface{})

AssertIN checks <value> is IN <expect>. The <expect> should be a slice, but the <value> can be a slice or a basic type variable. TODO map support.

func AssertLT

func AssertLT(value, expect interface{})

AssertLT checks <value> is LESS EQUAL THAN <expect>. Notice that, only string, integer and float types can be compared by AssertLT, others are invalid.

func AssertLTE

func AssertLTE(value, expect interface{})

AssertLTE checks <value> is LESS OR EQUAL THAN <expect>. Notice that, only string, integer and float types can be compared by AssertLTE, others are invalid.

func AssertNE

func AssertNE(value, expect interface{})

AssertNE checks <value> and <expect> NOT EQUAL.

func AssertNI

func AssertNI(value, expect interface{})

AssertNI checks <value> is NOT IN <expect>. The <expect> should be a slice, but the <value> can be a slice or a basic type variable. TODO map support.

func Case

func Case(t *testing.T, f func())

Case creates an unit test case. The param <t> is the pointer to testing.T of stdlib (*testing.T). The param <f> is the callback function for unit test case.

func Error

func Error(message ...interface{})

Error panics with given <message>.

func Fatal

func Fatal(message ...interface{})

Fatal prints <message> to stderr and exit the process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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