package io_test

import (
	"os"
	"strings"

	. "github.com/cloudfoundry/cli/testhelpers/io"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("io helpers", func() {
	It("will never overflow the pipe", func() {
		str := strings.Repeat("z", 75000)
		output := CaptureOutput(func() {
			os.Stdout.Write([]byte(str))
		})

		Expect(output).To(Equal([]string{str}))
	})
})

package io_test

import (
	"os"
	"strings"

	. "github.com/cloudfoundry/cli/testhelpers/io"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("io helpers", func() {
	It("will never overflow the pipe", func() {
		characters := make([]string, 0, 75000)
		for i := 0; i < 75000; i++ {
			characters = append(characters, "z")
		}

		str := strings.Join(characters, "")

		output := CaptureOutput(func() {
			os.Stdout.Write([]byte(str))
		})

		Expect(output).To(Equal([]string{str}))
	})
})

--- 
+++ 
@@ -11,13 +11,7 @@
 
 var _ = Describe("io helpers", func() {
 	It("will never overflow the pipe", func() {
-		characters := make([]string, 0, 75000)
-		for i := 0; i < 75000; i++ {
-			characters = append(characters, "z")
-		}
-
-		str := strings.Join(characters, "")
-
+		str := strings.Repeat("z", 75000)
 		output := CaptureOutput(func() {
 			os.Stdout.Write([]byte(str))
 		})
Speed up this test by a factor of a little bit more

Shoutout to @fraenkel for suggesting this stdlib function that's wicked
fast. Turns out that byte slices are ... really fast. Who knew???

Also, for interested parties :: this test just went from  0.003 seconds
to 0.001 seconds.
