dectest

package
v3.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test(t *testing.T, file string)

Types

type Case

type Case struct {
	ID         string
	Prec       int
	Clamp      bool
	Mode       RoundingMode
	MaxScale   int
	MinScale   int
	Op         Op
	Inputs     []Data
	Output     Data
	Conditions Condition
}

func (Case) ShortString

func (c Case) ShortString(length int) string

ShortString returns the same as String, except long data values are capped at length digits.

func (Case) String

func (c Case) String() string

type Data

type Data string

Data is input or output from a test case.

const NoData Data = "?"

NoData is output when the operation throws some sort of Condition and does not "return" any data.

func (Data) IsInf

func (i Data) IsInf() (int, bool)

IsInf returns a boolean indicating whether the data is an Infinity and an int indicating the signedness of the Infinity.

func (Data) IsNaN

func (i Data) IsNaN() (nan, signal bool)

IsNaN returns two booleans indicating whether the data is a NaN value and whether it's signaling or not.

func (Data) TrimQuotes

func (i Data) TrimQuotes() Data

type Op

type Op uint8

Op is a specific operation the test case must perform.

const (
	OpUnknownOp Op = iota
	OpAbs
	OpAdd
	OpAnd
	OpApply
	OpCanonical
	OpClass
	OpCompare
	OpCompareSig
	OpCompareTotal
	OpCompareTotMag
	OpCopy
	OpCopyAbs
	OpCopyNegate
	OpCopySign
	OpDivide
	OpDivideInt
	OpExp
	OpFMA
	OpInvert
	OpLn
	OpLog10
	OpLogB
	OpMax
	OpMaxMag
	OpMin
	OpMinMag
	OpMinus
	OpMultiply
	OpNextMinus
	OpNextPlus
	OpNextToward
	OpOr
	OpPlus
	OpPower
	OpQuantize
	OpReduce
	OpRemainder
	OpRemainderNear
	OpRescale
	OpRotate
	OpSameQuantum
	OpScaleB
	OpShift
	OpSquareRoot
	OpSubtract
	OpToEng
	OpToIntegral
	OpToIntegralX
	OpToSci
	OpTrim
	OpXor
)

func (Op) String

func (i Op) String() string

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(r io.Reader) *Scanner

func (*Scanner) Case

func (s *Scanner) Case() *Case

func (*Scanner) Err

func (s *Scanner) Err() error

func (*Scanner) Scan

func (s *Scanner) Scan() bool

Jump to

Keyboard shortcuts

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