package
Version:
v1.1.0-alpha
Opens a new window with list of versions in this module.
Published: Jul 26, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package assert 提供了一些断言函数。
-
func Check(cases Cases) error
-
func Equal(t *testing.T, got interface{}, expect interface{})
-
func Error(t *testing.T, got error, expr string)
-
func False(t *testing.T, got bool)
-
func Matches(t *testing.T, got string, expr string)
-
func Nil(t *testing.T, got interface{})
-
func NotEqual(t *testing.T, got interface{}, expect interface{})
-
func NotNil(t *testing.T, got interface{})
-
func Panic(t *testing.T, fn func(), expr string)
-
func True(t *testing.T, got bool)
-
type Cases
func Equal(t *testing.T, got interface{}, expect interface{})
Equal asserts that got and expect are equal as defined by reflect.DeepEqual.
Error asserts that a got error string matches a given regular expression.
False asserts that got is false.
Matches asserts that a got value matches a given regular expression.
Nil asserts that got is nil.
func NotEqual(t *testing.T, got interface{}, expect interface{})
NotEqual asserts that got and expect are not equal as defined by reflect.DeepEqual.
func NotNil(t *testing.T, got interface{})
NotNil asserts that got is not nil.
Panic asserts that function fn() would panic. It fails if the panic
message does not match the regular expression.
True asserts that got is true.
type Cases = []struct {
Condition bool
Message string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.