当前位置: 首页>>代码示例>>Golang>>正文


Golang miniassert.Equal函数代码示例

本文整理汇总了Golang中github.com/pilu/miniassert.Equal函数的典型用法代码示例。如果您正苦于以下问题:Golang Equal函数的具体用法?Golang Equal怎么用?Golang Equal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Equal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: TestRequest_Param

func TestRequest_Param(t *testing.T) {
	r, _ := http.NewRequest("GET", "http:///example.com?f=foo&b=bar", nil)
	request := newRequest(r)

	assert.Equal(t, "foo", request.Param("f"))
	assert.Equal(t, "bar", request.Param("b"))
}
开发者ID:jmptrader,项目名称:traffic,代码行数:7,代码来源:request_test.go

示例2: TestRecordingsHandler_WithReleaseIdNotFound

func TestRecordingsHandler_WithReleaseIdNotFound(t *testing.T) {
	recorder := newTestRequest("GET", "/releases/00000000-0000-0000-0000-000000000000/recordings.json")

	body := string(recorder.Body.Bytes())
	assert.Equal(t, `{"error":"release not found"}`+"\n", body)
	assert.Equal(t, 404, recorder.Code)
}
开发者ID:pilu,项目名称:cerebellum,代码行数:7,代码来源:recordings_handler_test.go

示例3: TestRouter_Add

func TestRouter_Add(t *testing.T) {
	router := New()
	assert.Equal(t, 0, len(router.routes["GET"]))
	route := router.Add(HttpMethod("GET"), "/", httpHandlerExample)
	assert.Type(t, "*traffic.Route", route)
	assert.Equal(t, 1, len(router.routes["GET"]))
}
开发者ID:jmptrader,项目名称:traffic,代码行数:7,代码来源:router_test.go

示例4: TestEnvironment_Url

func TestEnvironment_Url(t *testing.T) {
	e := &Environment{Live: false}
	assert.Equal(t, "http://test.lyricfind.com/api_service", e.Url().String())

	e = &Environment{Live: true}
	assert.Equal(t, "http://api.lyricfind.com", e.Url().String())
}
开发者ID:pilu,项目名称:lyricfind,代码行数:7,代码来源:client_test.go

示例5: TestRecordingsHandler_WithExistingdIdAndNonExsistingArtistId

func TestRecordingsHandler_WithExistingdIdAndNonExsistingArtistId(t *testing.T) {
	recorder := newTestRequest("GET", "/artists/00000000-0000-0000-0000-000000000000/releases/79215cdf-4764-4dee-b0b9-fec1643df7c5/recordings.json")

	body := string(recorder.Body.Bytes())
	assert.Equal(t, `{"error":"artist not found"}`+"\n", body)
	assert.Equal(t, 404, recorder.Code)
}
开发者ID:pilu,项目名称:cerebellum,代码行数:7,代码来源:recordings_handler_test.go

示例6: TestArtistHandler_WithIdNotFound

func TestArtistHandler_WithIdNotFound(t *testing.T) {
	recorder := newTestRequest("GET", "/artists/00000000-0000-0000-0000-000000000000.json")

	body := string(recorder.Body.Bytes())
	assert.Equal(t, `{"error":"artist not found"}`+"\n", body)
	assert.Equal(t, 404, recorder.Code)
}
开发者ID:pilu,项目名称:cerebellum,代码行数:7,代码来源:artist_handler_test.go

示例7: TestNewData

func TestNewData(t *testing.T) {
	data := NewData()

	assert.Equal(t, VERSION, data.Version)
	assert.Equal(t, []string{"log", "backtrace", "type"}, data.Columns)
	assert.Equal(t, 0, len(data.Rows))
}
开发者ID:pilu,项目名称:traffic-chromelogger,代码行数:7,代码来源:data_test.go

示例8: TestArtistHandler_WithInvalidUUID

func TestArtistHandler_WithInvalidUUID(t *testing.T) {
	recorder := newTestRequest("GET", "/artists/bad-uuid.json")

	body := string(recorder.Body.Bytes())
	assert.Equal(t, "", body)
	assert.Equal(t, 400, recorder.Code)
}
开发者ID:pilu,项目名称:cerebellum,代码行数:7,代码来源:artist_handler_test.go

示例9: TestGeometry_String

func TestGeometry_String(t *testing.T) {
	g := Geometry{200, 300}
	assert.Equal(t, "200x300", g.String())

	g = Geometry{200, 0}
	assert.Equal(t, "200x", g.String())
}
开发者ID:pilu,项目名称:matrioska,代码行数:7,代码来源:geometry_test.go

示例10: TestEncode

func TestEncode(t *testing.T) {
	assert.Equal(t, "0", Encode(0))
	assert.Equal(t, "1b", Encode(99))
	assert.Equal(t, "QNZ", Encode(101405))
	assert.Equal(t, "15y79wVi9XQ", Encode(920110421043409228))

}
开发者ID:jcoene,项目名称:go-base62,代码行数:7,代码来源:base62_test.go

示例11: TestRouter_Delete

func TestRouter_Delete(t *testing.T) {
	router := New()
	assert.Equal(t, 0, len(router.routes["DELETE"]))
	route := router.Delete("/", httpHandlerExample)
	assert.Type(t, "*traffic.Route", route)
	assert.Equal(t, 1, len(router.routes["DELETE"]))
}
开发者ID:jmptrader,项目名称:traffic,代码行数:7,代码来源:router_test.go

示例12: TestRecordingsHandler_WithInvalidReleaseId

func TestRecordingsHandler_WithInvalidReleaseId(t *testing.T) {
	recorder := newTestRequest("GET", "/releases/bad-uuid/recordings.json")

	body := string(recorder.Body.Bytes())
	assert.Equal(t, "", body)
	assert.Equal(t, 400, recorder.Code)
}
开发者ID:pilu,项目名称:cerebellum,代码行数:7,代码来源:recordings_handler_test.go

示例13: TestRouter_Patch

func TestRouter_Patch(t *testing.T) {
	router := New()
	assert.Equal(t, 0, len(router.routes["PATCH"]))
	route := router.Patch("/", httpHandlerExample)
	assert.Type(t, "*traffic.Route", route)
	assert.Equal(t, 1, len(router.routes["PATCH"]))
}
开发者ID:jmptrader,项目名称:traffic,代码行数:7,代码来源:router_test.go

示例14: TestLogData_Add

func TestLogData_Add(t *testing.T) {
	logData := make(LogData, 0)

	assert.Equal(t, 0, len(logData))

	logData.Add(1)
	assert.Equal(t, 1, len(logData))
}
开发者ID:pilu,项目名称:traffic-chromelogger,代码行数:8,代码来源:data_test.go

示例15: TestNewLogRow

func TestNewLogRow(t *testing.T) {
	logData := make(LogData, 0)
	row := NewLogRow(&logData, "foo.go:100", "log")

	assert.Equal(t, &logData, (*row)[0])
	assert.Equal(t, "foo.go:100", (*row)[1])
	assert.Equal(t, "log", (*row)[2])
}
开发者ID:pilu,项目名称:traffic-chromelogger,代码行数:8,代码来源:data_test.go


注:本文中的github.com/pilu/miniassert.Equal函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。