// Helper function to process a request and test its response
Helper function to process a request and test its response
// Helper function to process a request and test its response
func TestHTTPResponse(t *testing.T, app *App, req *http.Request, f func(w *httptest.ResponseRecorder) bool) {
	w := httptest.NewRecorder()
	app.Router.ServeHTTP(w, req)
	if !f(w) {
		t.Fail()
	}
}
func TestHTTPResponse ( t * testing . T , app * App , req * http . Request , f func ( w * httptest . ResponseRecorder ) bool ) { w := httptest . NewRecorder ( ) app . Router . ServeHTTP ( w , req ) if ! f ( w ) { t . Fail ( ) } }
Helper function to process a request and test its response
Helper function to process a request and test its response
// Create a response recorder // Create the service and process the above request.