Module: stdgo.testing.iotest
Overview
Index
-
function dataErrReader(_r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
-
function errReader(_err:stdgo.Error):stdgo._internal.io.Reader
-
function halfReader(_r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
-
function newReadLogger(_prefix:String, _r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
-
function newWriteLogger(_prefix:String, _w:stdgo._internal.io.Writer):stdgo._internal.io.Writer
-
function oneByteReader(_r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
-
function testDataErrReader_emptyReader(_t:stdgo._internal.testing.T_):Void
-
function testDataErrReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void
-
function testHalfReader_emptyReader(_t:stdgo._internal.testing.T_):Void
-
function testHalfReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void
-
function testOneByteReader_emptyReader(_t:stdgo._internal.testing.T_):Void
-
function testOneByteReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void
-
function testReadLogger_errorOnRead(_t:stdgo._internal.testing.T_):Void
-
function testReader(_r:stdgo._internal.io.Reader, _content:Array<UInt>):stdgo.Error
-
function testStringsReader(_t:stdgo._internal.testing.T_):Void
-
function testTimeOutReader_emptyReader(_t:stdgo._internal.testing.T_):Void
-
function testTimeOutReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void
-
function testTruncateWriter(_t:stdgo._internal.testing.T_):Void
-
function testWriteLogger(_t:stdgo._internal.testing.T_):Void
-
function testWriteLogger_errorOnWrite(_t:stdgo._internal.testing.T_):Void
-
function timeoutReader(_r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
-
function truncateWriter(_w:stdgo._internal.io.Writer, _n:haxe.Int64):stdgo._internal.io.Writer
Variables
import stdgo.testing.iotest.Iotest
var errTimeout:stdgo.Error
Classes
import stdgo.testing.iotest.*
class Iotest
Package iotest implements Readers and Writers useful mainly for testing.
Iotest function dataErrReader
function dataErrReader(_r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
DataErrReader changes the way errors are handled by a Reader. Normally, a
Reader returns an error (typically EOF) from the first Read call after the
last piece of data is read. DataErrReader wraps a Reader and changes its
behavior so the final error is returned along with the final data, instead
of in the first call after the final data.
Iotest function errReader
function errReader(_err:stdgo.Error):stdgo._internal.io.Reader
ErrReader returns an io.Reader that returns 0, err from all Read calls.
Iotest function halfReader
function halfReader(_r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
HalfReader returns a Reader that implements Read
by reading half as many requested bytes from r.
Iotest function newReadLogger
function newReadLogger(_prefix:String, _r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
NewReadLogger returns a reader that behaves like r except
that it logs (using log.Printf) each read to standard error,
printing the prefix and the hexadecimal data read.
Iotest function newWriteLogger
function newWriteLogger(_prefix:String, _w:stdgo._internal.io.Writer):stdgo._internal.io.Writer
NewWriteLogger returns a writer that behaves like w except
that it logs (using log.Printf) each write to standard error,
printing the prefix and the hexadecimal data written.
Iotest function oneByteReader
function oneByteReader(_r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
OneByteReader returns a Reader that implements
each non-empty Read by reading one byte from r.
Iotest function testDataErrReader_emptyReader
function testDataErrReader_emptyReader(_t:stdgo._internal.testing.T_):Void
Iotest function testDataErrReader_nonEmptyReader
function testDataErrReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void
Iotest function testErrReader
function testErrReader(_t:stdgo._internal.testing.T_):Void
Iotest function testHalfReader_emptyReader
function testHalfReader_emptyReader(_t:stdgo._internal.testing.T_):Void
Iotest function testHalfReader_nonEmptyReader
function testHalfReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void
Iotest function testOneByteReader_emptyReader
function testOneByteReader_emptyReader(_t:stdgo._internal.testing.T_):Void
Iotest function testOneByteReader_nonEmptyReader
function testOneByteReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void
Iotest function testReadLogger
function testReadLogger(_t:stdgo._internal.testing.T_):Void
Iotest function testReadLogger_errorOnRead
function testReadLogger_errorOnRead(_t:stdgo._internal.testing.T_):Void
Iotest function testReader
function testReader(_r:stdgo._internal.io.Reader, _content:Array<UInt>):stdgo.Error
TestReader tests that reading from r returns the expected file content.
It does reads of different sizes, until EOF.
If r implements io.ReaderAt or io.Seeker, TestReader also checks
that those operations behave as they should.
If TestReader finds any misbehaviors, it returns an error reporting them. The error text may span multiple lines.
Iotest function testStringsReader
function testStringsReader(_t:stdgo._internal.testing.T_):Void
Iotest function testTimeOutReader_emptyReader
function testTimeOutReader_emptyReader(_t:stdgo._internal.testing.T_):Void
Iotest function testTimeOutReader_nonEmptyReader
function testTimeOutReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void
Iotest function testTruncateWriter
function testTruncateWriter(_t:stdgo._internal.testing.T_):Void
Iotest function testWriteLogger
function testWriteLogger(_t:stdgo._internal.testing.T_):Void
Iotest function testWriteLogger_errorOnWrite
function testWriteLogger_errorOnWrite(_t:stdgo._internal.testing.T_):Void
Iotest function timeoutReader
function timeoutReader(_r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
TimeoutReader returns ErrTimeout on the second read
with no data. Subsequent calls to read succeed.
Iotest function truncateWriter
function truncateWriter(_w:stdgo._internal.io.Writer, _n:haxe.Int64):stdgo._internal.io.Writer
TruncateWriter returns a Writer that writes to w
but stops silently after n bytes.
Typedefs
import stdgo.testing.iotest.*
typedef T__struct_0
typedef T__struct_0 = stdgo._internal.testing.iotest.T__struct_0;