dataset

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Internal package used to check if functions work correctly by dataset. It is necessary because when testing functions with a variable number of arguments starting with four arguments, it is impossible to conduct testing on the entire range of input argument values ​​in automatic mode in an acceptable time.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotEnoughDataInFillers = errors.New("not enough data from the fillers to form a dataset")
	ErrNotEnoughDataInItem    = errors.New("not enough data in dataset item")
	ErrReaderNotSpecified     = errors.New("reader is not specified")
	ErrWriterNotSpecified     = errors.New("writer is not specified")
)

Functions

func Collect added in v0.20.3

func Collect[Type types.UpToI32](opts Opts[Type], writer io.Writer) error

Performs collecting dataset to writer.

func CollectToFile added in v0.20.3

func CollectToFile[Type types.UpToI32](opts Opts[Type], path string) error

Performs collecting dataset to file.

func Inspect added in v0.20.3

func Inspect[Type types.UpToI32](
	inspected types.Inspected[Type, Type],
	reader io.Reader,
) (types.Result[Type, Type, int64], error)

Performs inspecting with dataset from reader.

func InspectFromFile

func InspectFromFile[Type types.UpToI32](
	inspected types.Inspected[Type, Type],
	path string,
) (types.Result[Type, Type, int64], error)

Performs inspecting with dataset from file.

func WriteItem

func WriteItem[Type types.UpToI32](
	writer io.Writer,
	reference types.Reference[int64],
	args ...Type,
) error

Writes dataset item to specified writer.

Types

type Opts added in v0.20.3

type Opts[Type types.UpToI32] struct {
	// Quantity of arguments for inspected and reference functions
	ArgsQuantity int

	// Quantity of dataset items which not produce overflow of inspected function
	NotOverflowedItemsQuantity int

	// Quantity of dataset items which produce overflow of inspected function
	OverflowedItemsQuantity int

	// Function that returns a reference value
	types.Reference[int64]

	// Quantity limits for reference values
	ReferenceLimits map[int64]uint

	// List of fillers that fill arguments of dataset item (reference function) by
	// values. If not specified will be used filler [filler.Set] with
	// [filler.Boundaries] setter and filler [filler.Rand]
	Fillers []filler.Filler[Type]
}

Options of collecting. A reference function must be specified.

Directories

Path Synopsis
Internal package with various fillers that fill arguments of dataset item by values.
Internal package with various fillers that fill arguments of dataset item by values.

Jump to

Keyboard shortcuts

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