gf: github.com/gogf/gf/g/test/gtest Index | Files

package gtest

import "github.com/gogf/gf/g/test/gtest"

Package gtest provides convenient test utilities for unit testing.

Index

Package Files

gtest.go

func Assert Uses

func Assert(value, expect interface{})

Assert checks <value> and <expect> EQUAL.

func AssertEQ Uses

func AssertEQ(value, expect interface{})

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

func AssertGE Uses

func AssertGE(value, expect interface{})

AssertGE 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 AssertGT Uses

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 Uses

func AssertGTE(value, expect interface{})

Deprecated. See AssertGE.

func AssertIN Uses

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 AssertLE Uses

func AssertLE(value, expect interface{})

AssertLE 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 AssertLT Uses

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 Uses

func AssertLTE(value, expect interface{})

Deprecated. See AssertLE.

func AssertNE Uses

func AssertNE(value, expect interface{})

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

func AssertNI Uses

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 Uses

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

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

func Error Uses

func Error(message ...interface{})

Error panics with given <message>.

func Fatal Uses

func Fatal(message ...interface{})

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

Package gtest imports 8 packages (graph). Updated 2019-07-20. Refresh now. Tools for package owners.