Skip to content

tnuanchuay/fasthttp-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fasthttp-test

for people who want to do integration test valyala/fasthttp

get

go get github.com/tspn/fasthttp-test

example

func Handler(ctx *fasthttp.RequestCtx){
	ctx.WriteString("example")
}

func TestSimpleGETRequest(t *testing.T){
	resp, body, errs := fasthttp_test.StartServerOnPort(t, fasthttp_test.GET, "/example", 9000, Handler, nil)

	if errs != nil {
		for _, err := range errs {
			t.Error(err)
		}
	}

	if resp == nil {
		t.Error("Response is nil")
	}

	if body != "example" {
		t.Error("expected example but got", body)
	}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages