go2hx

manual

github

Module: stdgo.testing.iotest

(view library index)

Overview

Index

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.

(view code)

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.

(view code)

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.

(view code)

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.

(view code)

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.

(view code)

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.

(view code)

Iotest function testDataErrReader_emptyReader

function testDataErrReader_emptyReader(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testDataErrReader_nonEmptyReader

function testDataErrReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testErrReader

function testErrReader(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testHalfReader_emptyReader

function testHalfReader_emptyReader(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testHalfReader_nonEmptyReader

function testHalfReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testOneByteReader_emptyReader

function testOneByteReader_emptyReader(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testOneByteReader_nonEmptyReader

function testOneByteReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testReadLogger

function testReadLogger(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testReadLogger_errorOnRead

function testReadLogger_errorOnRead(_t:stdgo._internal.testing.T_):Void

(view code)

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.

(view code)

Iotest function testStringsReader

function testStringsReader(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testTimeOutReader_emptyReader

function testTimeOutReader_emptyReader(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testTimeOutReader_nonEmptyReader

function testTimeOutReader_nonEmptyReader(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testTruncateWriter

function testTruncateWriter(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testWriteLogger

function testWriteLogger(_t:stdgo._internal.testing.T_):Void

(view code)

Iotest function testWriteLogger_errorOnWrite

function testWriteLogger_errorOnWrite(_t:stdgo._internal.testing.T_):Void

(view code)

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.

(view code)

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.

(view code)

Typedefs

import stdgo.testing.iotest.*

typedef T__struct_0

typedef T__struct_0 = stdgo._internal.testing.iotest.T__struct_0;

Abstracts

abstract T_writeLogger

(view file containing code)

abstract T_readLogger

(view file containing code)

abstract T_errWriter

(view file containing code)

abstract T_oneByteReader

(view file containing code)

abstract T_halfReader

(view file containing code)

abstract T_dataErrReader

(view file containing code)

abstract T_timeoutReader

(view file containing code)

abstract T_errReader

(view file containing code)

abstract T_smallByteReader

(view file containing code)

abstract T_truncateWriter

(view file containing code)