go/src/bufio/bufio_test.go

type rot13Reader

func newRot13Reader(r io.Reader) *rot13Reader {}

func (r13 *rot13Reader) Read(p []byte) (int, error) {}

// Call ReadByte to accumulate the text of a file
func readBytes(buf *Reader) string {}

func TestReaderSimple(t *testing.T) {}

type readMaker

var readMakers

// Call ReadString (which ends up calling everything else)
// to accumulate the text of a file.
func readLines(b *Reader) string {}

// Call Read to accumulate the text of a file
func reads(buf *Reader, m int) string {}

type bufReader

var bufreaders

const minReadBufferSize

var bufsizes

func TestReader(t *testing.T) {}

type zeroReader

func (zeroReader) Read(p []byte) (int, error) {}

func TestZeroReader(t *testing.T) {}

type StringReader

func (r *StringReader) Read(p []byte) (n int, err error) {}

func readRuneSegments(t *testing.T, segments []string) {}

var segmentList

func TestReadRune(t *testing.T) {}

func TestUnreadRune(t *testing.T) {}

func TestNoUnreadRuneAfterPeek(t *testing.T) {}

func TestNoUnreadByteAfterPeek(t *testing.T) {}

func TestNoUnreadRuneAfterDiscard(t *testing.T) {}

func TestNoUnreadByteAfterDiscard(t *testing.T) {}

func TestNoUnreadRuneAfterWriteTo(t *testing.T) {}

func TestNoUnreadByteAfterWriteTo(t *testing.T) {}

func TestUnreadByte(t *testing.T) {}

func TestUnreadByteMultiple(t *testing.T) {}

func TestUnreadByteOthers(t *testing.T) {}

// Test that UnreadRune fails if the preceding operation was not a ReadRune.
func TestUnreadRuneError(t *testing.T) {}

func TestUnreadRuneAtEOF(t *testing.T) {}

func TestReadWriteRune(t *testing.T) {}

func TestWriteInvalidRune(t *testing.T) {}

func TestReadStringAllocs(t *testing.T) {}

func TestWriter(t *testing.T) {}

func TestWriterAppend(t *testing.T) {}

type errorWriterTest

func (w errorWriterTest) Write(p []byte) (int, error) {}

var errorWriterTests

func TestWriteErrors(t *testing.T) {}

func TestNewReaderSizeIdempotent(t *testing.T) {}

func TestNewWriterSizeIdempotent(t *testing.T) {}

func TestWriteString(t *testing.T) {}

func TestWriteStringStringWriter(t *testing.T) {}

type teststringwriter

func (w *teststringwriter) Write(b []byte) (int, error) {}

func (w *teststringwriter) WriteString(s string) (int, error) {}

func (w *teststringwriter) check(t *testing.T, write, writeString string) {}

func TestBufferFull(t *testing.T) {}

func TestPeek(t *testing.T) {}

type dataAndEOFReader

func (r dataAndEOFReader) Read(p []byte) (int, error) {}

func TestPeekThenUnreadRune(t *testing.T) {}

var testOutput

var testInput

var testInputrn

type testReader

func (t *testReader) Read(buf []byte) (n int, err error) {}

func testReadLine(t *testing.T, input []byte) {}

func TestReadLine(t *testing.T) {}

func TestLineTooLong(t *testing.T) {}

func TestReadAfterLines(t *testing.T) {}

func TestReadEmptyBuffer(t *testing.T) {}

func TestLinesAfterRead(t *testing.T) {}

func TestReadLineNonNilLineOrError(t *testing.T) {}

type readLineResult

var readLineNewlinesTests

func TestReadLineNewlines(t *testing.T) {}

func testReadLineNewlines(t *testing.T, input string, expect []readLineResult) {}

func createTestInput(n int) []byte {}

func TestReaderWriteTo(t *testing.T) {}

type errorWriterToTest

func (r errorWriterToTest) Read(p []byte) (int, error) {}

func (w errorWriterToTest) Write(p []byte) (int, error) {}

var errorWriterToTests

func TestReaderWriteToErrors(t *testing.T) {}

func TestWriterReadFrom(t *testing.T) {}

type errorReaderFromTest

func (r errorReaderFromTest) Read(p []byte) (int, error) {}

func (w errorReaderFromTest) Write(p []byte) (int, error) {}

var errorReaderFromTests

func TestWriterReadFromErrors(t *testing.T) {}

// TestWriterReadFromCounts tests that using io.Copy to copy into a
// bufio.Writer does not prematurely flush the buffer. For example, when
// buffering writes to a network socket, excessive network writes should be
// avoided.
func TestWriterReadFromCounts(t *testing.T) {}

type writeCountingDiscard

func (w *writeCountingDiscard) Write(p []byte) (int, error) {}

type negativeReader

func (r *negativeReader) Read([]byte) (int, error) {}

func TestNegativeRead(t *testing.T) {}

var errFake

type errorThenGoodReader

func (r *errorThenGoodReader) Read(p []byte) (int, error) {}

func TestReaderClearError(t *testing.T) {}

// Test for golang.org/issue/5947
func TestWriterReadFromWhileFull(t *testing.T) {}

type emptyThenNonEmptyReader

func (r *emptyThenNonEmptyReader) Read(p []byte) (int, error) {}

// Test for golang.org/issue/7611
func TestWriterReadFromUntilEOF(t *testing.T) {}

func TestWriterReadFromErrNoProgress(t *testing.T) {}

type readFromWriter

func (w *readFromWriter) Write(p []byte) (int, error) {}

func (w *readFromWriter) ReadFrom(r io.Reader) (int64, error) {}

// Test that calling (*Writer).ReadFrom with a partially-filled buffer
// fills the buffer before switching over to ReadFrom.
func TestWriterReadFromWithBufferedData(t *testing.T) {}

func TestReadZero(t *testing.T) {}

func TestReaderReset(t *testing.T) {}

func TestWriterReset(t *testing.T) {}

func TestReaderDiscard(t *testing.T) {}

func TestReaderSize(t *testing.T) {}

func TestWriterSize(t *testing.T) {}

type onlyReader

type onlyWriter

type scriptedReader

func (sr *scriptedReader) Read(p []byte) (n int, err error) {}

func newScriptedReader(steps ...func(p []byte) (n int, err error)) io.Reader {}

type eofReader

func (r *eofReader) Read(p []byte) (int, error) {}

func TestPartialReadEOF(t *testing.T) {}

type writerWithReadFromError

func (w writerWithReadFromError) ReadFrom(r io.Reader) (int64, error) {}

func (w writerWithReadFromError) Write(b []byte) (n int, err error) {}

func TestWriterReadFromMustSetUnderlyingError(t *testing.T) {}

type writeErrorOnlyWriter

func (w writeErrorOnlyWriter) Write(p []byte) (n int, err error) {}

// Ensure that previous Write errors are immediately returned
// on any ReadFrom. See golang.org/issue/35194.
func TestWriterReadFromMustReturnUnderlyingError(t *testing.T) {}

func BenchmarkReaderCopyOptimal(b *testing.B) {}

func BenchmarkReaderCopyUnoptimal(b *testing.B) {}

func BenchmarkReaderCopyNoWriteTo(b *testing.B) {}

func BenchmarkReaderWriteToOptimal(b *testing.B) {}

func BenchmarkReaderReadString(b *testing.B) {}

func BenchmarkWriterCopyOptimal(b *testing.B) {}

func BenchmarkWriterCopyUnoptimal(b *testing.B) {}

func BenchmarkWriterCopyNoReadFrom(b *testing.B) {}

func BenchmarkReaderEmpty(b *testing.B) {}

func BenchmarkWriterEmpty(b *testing.B) {}

func BenchmarkWriterFlush(b *testing.B) {}