go/src/fmt/scan_test.go

type ScanTest

type ScanfTest

type ScanfMultiTest

var boolVal

var intVal

var int8Val

var int16Val

var int32Val

var int64Val

var uintVal

var uint8Val

var uint16Val

var uint32Val

var uint64Val

var uintptrVal

var float32Val

var float64Val

var stringVal

var bytesVal

var runeVal

var complex64Val

var complex128Val

var renamedBoolVal

var renamedIntVal

var renamedInt8Val

var renamedInt16Val

var renamedInt32Val

var renamedInt64Val

var renamedUintVal

var renamedUint8Val

var renamedUint16Val

var renamedUint32Val

var renamedUint64Val

var renamedUintptrVal

var renamedStringVal

var renamedBytesVal

var renamedFloat32Val

var renamedFloat64Val

var renamedComplex64Val

var renamedComplex128Val

type Xs

func (x *Xs) Scan(state ScanState, verb rune) error {}

var xVal

type IntString

func (s *IntString) Scan(state ScanState, verb rune) error {}

var intStringVal

var scanTests

var scanfTests

var overflowTests

var truth

var (
	i
	j
	k
)

var f

var (
	s
	t
)

var c

var (
	x
	y
)

var z

var (
	r1
	r2
	r3
)

var multiTests

var readers

func testScan(t *testing.T, f func(string) io.Reader, scan func(r io.Reader, a ...any) (int, error)) {}

func TestScan(t *testing.T) {}

func TestScanln(t *testing.T) {}

func TestScanf(t *testing.T) {}

func TestScanOverflow(t *testing.T) {}

func verifyNaN(str string, t *testing.T) {}

func TestNaN(t *testing.T) {}

func verifyInf(str string, t *testing.T) {}

func TestInf(t *testing.T) {}

func testScanfMulti(t *testing.T, f func(string) io.Reader) {}

func TestScanfMulti(t *testing.T) {}

func TestScanMultiple(t *testing.T) {}

// Empty strings are not valid input when scanning a string.
func TestScanEmpty(t *testing.T) {}

func TestScanNotPointer(t *testing.T) {}

func TestScanlnNoNewline(t *testing.T) {}

func TestScanlnWithMiddleNewline(t *testing.T) {}

type eofCounter

func (ec *eofCounter) Read(b []byte) (n int, err error) {}

// TestEOF verifies that when we scan, we see at most EOF once per call to a
// Scan function, and then only when it's really an EOF.
func TestEOF(t *testing.T) {}

// TestEOFAtEndOfInput verifies that we see an EOF error if we run out of input.
// This was a buglet: we used to get "expected integer".
func TestEOFAtEndOfInput(t *testing.T) {}

var eofTests

func TestEOFAllTypes(t *testing.T) {}

// TestUnreadRuneWithBufio verifies that, at least when using bufio, successive
// calls to Fscan do not lose runes.
func TestUnreadRuneWithBufio(t *testing.T) {}

type TwoLines

// Scan attempts to read two lines into the object. Scanln should prevent this
// because it stops at newline; Scan and Scanf should be fine.
func (t *TwoLines) Scan(state ScanState, verb rune) error {}

func TestMultiLine(t *testing.T) {}

// TestLineByLineFscanf tests that Fscanf does not read past newline. Issue
// 3481.
func TestLineByLineFscanf(t *testing.T) {}

type runeScanner

func (rs *runeScanner) Scan(state ScanState, verb rune) error {}

func TestScanStateCount(t *testing.T) {}

type RecursiveInt

func (r *RecursiveInt) Scan(state ScanState, verb rune) (err error) {}

// scanInts performs the same scanning task as RecursiveInt.Scan
// but without recurring through scanner, so we can compare
// performance more directly.
func scanInts(r *RecursiveInt, b *bytes.Buffer) (err error) {}

func makeInts(n int) []byte {}

func TestScanInts(t *testing.T) {}

const intCount

func testScanInts(t *testing.T, scan func(*RecursiveInt, *bytes.Buffer) error) {}

func BenchmarkScanInts(b *testing.B) {}

func BenchmarkScanRecursiveInt(b *testing.B) {}

func BenchmarkScanRecursiveIntReaderWrapper(b *testing.B) {}

// Issue 9124.
// %x on bytes couldn't handle non-space bytes terminating the scan.
func TestHexBytes(t *testing.T) {}

func TestScanNewlinesAreSpaces(t *testing.T) {}

func TestScanlnNewlinesTerminate(t *testing.T) {}

func TestScanfNewlineMatchFormat(t *testing.T) {}

type hexBytes

func (h *hexBytes) Scan(ss ScanState, verb rune) error {}

func TestHexByte(t *testing.T) {}