testtools

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestDataDir = filepath.Join(filepath.Dir(callerPath), "../testdata")
)

Functions

func AssertStreamerHasCorrectReturnBehaviour added in v1.3.0

func AssertStreamerHasCorrectReturnBehaviour(t *testing.T, s beep.Streamer, expectedSamples int)

AssertStreamerHasCorrectReturnBehaviour tests whether the return values returned by the streamer s adhere to the description on the Streamer interface.

func Collect

func Collect(s beep.Streamer) [][2]float64

Collect drains Streamer s and returns all the samples it streamed.

func CollectNum

func CollectNum(num int, s beep.Streamer) [][2]float64

CollectNum collects num samples from the streamer in chunks and returns them all.

func RandomDataStreamer

func RandomDataStreamer(numSamples int) (s beep.StreamSeeker, data [][2]float64)

RandomDataStreamer generates numSamples random samples and returns a StreamSeeker to stream them.

func TestFilePath

func TestFilePath(path string) string

Types

type ErrorStreamer added in v1.3.0

type ErrorStreamer struct {
	Error error
}

func (ErrorStreamer) Err added in v1.3.0

func (e ErrorStreamer) Err() error

func (ErrorStreamer) Stream added in v1.3.0

func (e ErrorStreamer) Stream(samples [][2]float64) (n int, ok bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL