func TestLargeString(t *testing.T) {
	largeStringReader := generateLargeString()
	b, err := ioutil.ReadAll(largeStringReader)
	if err != nil {
		t.Fatalf("Failed to read large string into buffer: %v", err)
	}
	expected := strconv.Quote(string(b))

	buffer := bytes.NewBufferString("\"")
	converter := New()

	largeStringReader = generateLargeString()
	_, err = converter.Convert(largeStringReader, buffer)
	if err != nil {
		t.Fatalf("Converter failed: %v", err)
	}
	buffer.WriteRune('"')
	got := buffer.String()
	if got != expected {
		t.Fatalf("Large string does not match")
	}
}
// TestLargeString tests that converter and strconv.Quote
// return the same result for the large string.
TestLargeString tests that converter and strconv.Quote
return the same result for the large string.
// TestLargeString tests that converter and strconv . Quote // return the same result for the large string .
func TestLargeString(t *testing.T) {
	largeStringReader := generateLargeString()
	b, err := ioutil.ReadAll(largeStringReader)
	if err != nil {
		t.Fatalf("Failed to read large string into buffer: %v", err)
	}
	expected := strconv.Quote(string(b))
	buffer := bytes.NewBufferString("\"")
	converter := New()
	largeStringReader = generateLargeString()
	_, err = converter.Convert(largeStringReader, buffer)
	if err != nil {
		t.Fatalf("Converter failed: %v", err)
	}
	buffer.WriteRune('"')
	got := buffer.String()
	if got != expected {
		t.Fatalf("Large string does not match")
	}
}
func TestLargeString ( t * testing . T ) { largeStringReader := generateLargeString ( ) b , err := ioutil . ReadAll ( largeStringReader ) if err != nil { t . Fatalf ( " " , err ) } expected := strconv . Quote ( string ( b ) ) buffer := bytes . NewBufferString ( " \" " ) converter := New ( ) largeStringReader = generateLargeString ( ) _ , err = converter . Convert ( largeStringReader , buffer ) if err != nil { t . Fatalf ( " " , err ) } buffer . WriteRune ( '"' ) got := buffer . String ( ) if got != expected { t . Fatalf ( " " ) } }
TestLargeString tests that converter and strconv.Quote
return the same result for the large string.
TestLargeString tests that converter and strconv . Quote return the same result for the large string .