go/src/bufio/scan_test.go

const smallMaxTokenSize

// Test white space table matches the Unicode definition.
func TestSpace(t *testing.T) {}

var scanTests

func TestScanByte(t *testing.T) {}

// Test that the rune splitter returns same sequence of runes (not bytes) as for range string.
func TestScanRune(t *testing.T) {}

var wordScanTests

// Test that the word splitter returns the same data as strings.Fields.
func TestScanWords(t *testing.T) {}

type slowReader

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

// genLine writes to buf a predictable but non-trivial line of text of length
// n, including the terminal newline and an occasional carriage return.
// If addNewline is false, the \r and \n are not emitted.
func genLine(buf *bytes.Buffer, lineNum, n int, addNewline bool) {}

// Test the line splitter, including some carriage returns but no long lines.
func TestScanLongLines(t *testing.T) {}

// Test that the line splitter errors out on a long line.
func TestScanLineTooLong(t *testing.T) {}

// Test that the line splitter handles a final line without a newline.
func testNoNewline(text string, lines []string, t *testing.T) {}

// Test that the line splitter handles a final line without a newline.
func TestScanLineNoNewline(t *testing.T) {}

// Test that the line splitter handles a final line with a carriage return but no newline.
func TestScanLineReturnButNoNewline(t *testing.T) {}

// Test that the line splitter handles a final empty line.
func TestScanLineEmptyFinalLine(t *testing.T) {}

// Test that the line splitter handles a final empty line with a carriage return but no newline.
func TestScanLineEmptyFinalLineWithCR(t *testing.T) {}

var testError

// Test the correct error is returned when the split function errors out.
func TestSplitError(t *testing.T) {}

// Test that an EOF is overridden by a user-generated scan error.
func TestErrAtEOF(t *testing.T) {}

type alwaysError

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

func TestNonEOFWithEmptyRead(t *testing.T) {}

type endlessZeros

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

func TestBadReader(t *testing.T) {}

func TestScanWordsExcessiveWhiteSpace(t *testing.T) {}

func commaSplit(data []byte, atEOF bool) (advance int, token []byte, err error) {}

func testEmptyTokens(t *testing.T, text string, values []string) {}

func TestEmptyTokens(t *testing.T) {}

func TestWithNoEmptyTokens(t *testing.T) {}

func loopAtEOFSplit(data []byte, atEOF bool) (advance int, token []byte, err error) {}

func TestDontLoopForever(t *testing.T) {}

func TestBlankLines(t *testing.T) {}

type countdown

func (c *countdown) split(data []byte, atEOF bool) (advance int, token []byte, err error) {}

// Check that the looping-at-EOF check doesn't trigger for merely empty tokens.
func TestEmptyLinesOK(t *testing.T) {}

// Make sure we can read a huge token if a big enough buffer is provided.
func TestHugeBuffer(t *testing.T) {}

type negativeEOFReader

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

// Test that the scanner doesn't panic and returns ErrBadReadCount
// on a reader that returns a negative count of bytes read (issue 38053).
func TestNegativeEOFReader(t *testing.T) {}

type largeReader

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

// Test that the scanner doesn't panic and returns ErrBadReadCount
// on a reader that returns an impossibly large count of bytes read (issue 38053).
func TestLargeReader(t *testing.T) {}