...

Source file src/github.com/gin-gonic/gin/render/reader_test.go

Documentation: github.com/gin-gonic/gin/render

     1  // Copyright 2019 Gin Core Team. All rights reserved.
     2  // Use of this source code is governed by a MIT style
     3  // license that can be found in the LICENSE file.
     4  
     5  package render
     6  
     7  import (
     8  	"net/http/httptest"
     9  	"strings"
    10  	"testing"
    11  
    12  	"github.com/stretchr/testify/require"
    13  )
    14  
    15  func TestReaderRenderNoHeaders(t *testing.T) {
    16  	content := "test"
    17  	r := Reader{
    18  		ContentLength: int64(len(content)),
    19  		Reader:        strings.NewReader(content),
    20  	}
    21  	err := r.Render(httptest.NewRecorder())
    22  	require.NoError(t, err)
    23  }
    24  

View as plain text