func TestWriteHTTPNoNewline(t *testing.T) {
	listener := newTestHTTPListener()

	acc := &testutil.Accumulator{}
	require.NoError(t, listener.Start(acc))
	defer listener.Stop()

	// post single message to listener
	resp, err := http.Post(createURL(listener, "http", "/write", "db=mydb"), "", bytes.NewBuffer([]byte(testMsgNoNewline)))
	require.NoError(t, err)
	resp.Body.Close()
	require.EqualValues(t, 204, resp.StatusCode)

	acc.Wait(1)
	acc.AssertContainsTaggedFields(t, "cpu_load_short",
		map[string]interface{}{"value": float64(12)},
		map[string]string{"host": "server01"},
	)
}
// http listener should add a newline at the end of the buffer if it's not there
http listener should add a newline at the end of the buffer if it's not there
// http listener should add a newline at the end of the buffer if it ' s not there
func TestWriteHTTPNoNewline(t *testing.T) {
	listener := newTestHTTPListener()
	acc := &testutil.Accumulator{}
	require.NoError(t, listener.Start(acc))
	defer listener.Stop()
	resp, err := http.Post(createURL(listener, "http", "/write", "db=mydb"), "", bytes.NewBuffer([]byte(testMsgNoNewline)))
	require.NoError(t, err)
	resp.Body.Close()
	require.EqualValues(t, 204, resp.StatusCode)
	acc.Wait(1)
	acc.AssertContainsTaggedFields(t, "cpu_load_short",
		map[string]interface{}{"value": float64(12)},
		map[string]string{"host": "server01"},
	)
}
func TestWriteHTTPNoNewline ( t * testing . T ) { listener := newTestHTTPListener ( ) acc := & testutil . Accumulator { } require . NoError ( t , listener . Start ( acc ) ) defer listener . Stop ( ) resp , err := http . Post ( createURL ( listener , " " , " " , " " ) , " " , bytes . NewBuffer ( [ ] byte ( testMsgNoNewline ) ) ) require . NoError ( t , err ) resp . Body . Close ( ) require . EqualValues ( t , 204 , resp . StatusCode ) acc . Wait ( 1 ) acc . AssertContainsTaggedFields ( t , " " , map [ string ] interface { } { " " : float64 ( 12 ) } , map [ string ] string { " " : " " } , ) }
http listener should add a newline at the end of the buffer if it's not there
http listener should add a newline at the end of the buffer if it ' s not there
// post single message to listener