Documentation
¶
Index ¶
- func AssertContentType(t *testing.T, response *httptest.ResponseRecorder, want string)
- func AssertDeepEqual(t *testing.T, got, want interface{})
- func AssertEquals(t *testing.T, got, want interface{})
- func AssertNoError(t *testing.T, err error)
- func AssertWebsocketGotMsg(t *testing.T, ws *websocket.Conn, want string)
- func CreateTempFile(t *testing.T, initialData string, filename string) (*os.File, func())
- func RetryUntil(t *testing.T, d time.Duration, assert func() bool) bool
- func Within(t testing.TB, d time.Duration, assert func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertContentType ¶
func AssertContentType(t *testing.T, response *httptest.ResponseRecorder, want string)
AssertContentType 比对 respose content-type 是否一致
func AssertDeepEqual ¶
AssertDeepEqual 使用 reflect.DeepEqual 比对两个任意类型是否相等
func AssertEquals ¶
AssertEquals 比对两个基本类型是否相等
func AssertWebsocketGotMsg ¶
AssertWebsocketGotMsg 比对从 ws 中读取的信息是否与 want 相等
func CreateTempFile ¶
CreateTempFile 创建临时文件, 返回文件关闭函数句柄
func RetryUntil ¶
RetryUntil 在指定时间内, 重复执行 assert 函数, 如果成果返回 true, 否则测试失败
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.