Documentation
¶
Overview ¶
Package testcases provides test cases for testing nil, equal, empty and zero values.
Index ¶
- Constants
- Variables
- func TFuncA()
- func TFuncB()
- type EqualCase
- type TA
- type TB
- type TC
- type TD
- type TInt
- type TIntStr
- type TIntType
- type TItf
- type TLoc
- type TNested
- type TPrv
- func (prv TPrv) SetAInt(a [2]int) TPrv
- func (prv TPrv) SetCh(ch chan int) TPrv
- func (prv TPrv) SetFn(fn func() int) TPrv
- func (prv TPrv) SetInt(v int) TPrv
- func (prv TPrv) SetMapII(m map[int]int) TPrv
- func (prv TPrv) SetPtr(ptr *TVal) TPrv
- func (prv TPrv) SetSInt(s []int) TPrv
- func (prv TPrv) SetTim(tim time.Time) TPrv
- type TPtr
- type TRec
- type TStrType
- type TTim
- type TVal
- type ZENValue
Constants ¶
View Source
const ( TCBoolA bool = true TCBoolB bool = true TCBoolC bool = false TCStringA string = "abc" TCStringB string = "abc" TCStringC string = "cba" TCIntA int = -123 TCIntB int = -123 TCIntC int = -321 TCInt8A int8 = -8 TCInt8B int8 = -8 TCInt8C int8 = -13 TCInt16A int16 = -16 TCInt16B int16 = -16 TCInt16C int16 = -61 TCInt32A int32 = -32 TCInt32B int32 = -32 TCInt32C int32 = -23 TCInt64A int64 = -64 TCInt64B int64 = -64 TCInt64C int64 = -46 TCUintA uint = 123 TCUintB uint = 123 TCUintC uint = 321 TCUint8A uint8 = 8 TCUint8B uint8 = 8 TCUint8C uint8 = 13 TCUint16A uint16 = 16 TCUint16B uint16 = 16 TCUint16C uint16 = 61 TCUint32A uint32 = 32 TCUint32B uint32 = 32 TCUint32C uint32 = 23 TCUint64A uint64 = 64 TCUint64B uint64 = 64 TCUint64C uint64 = 46 TCUintptrA uintptr = 42 TCUintptrB uintptr = 42 TCUintptrC uintptr = 24 TCFloat32A float32 = 32.0 TCFloat32B float32 = 32.0 TCFloat32C float32 = 23.0 TCFloat64A float64 = 64.0 TCFloat64B float64 = 64.0 TCFloat64C float64 = 46.0 TCComplex64A complex64 = 6i + 4 TCComplex64B complex64 = 6i + 4 TCComplex64C complex64 = 4i + 6 TCComplex128A complex128 = 12i + 8 TCComplex128B complex128 = 12i + 8 TCComplex128C complex128 = 8i + 12 CBoolA = true CBoolB = true CBoolC = false CStringA = "abc" CStringB = "abc" CStringC = "xyz" CIntA = 123 CIntB = 123 CIntC = 321 CFloatA = 1.23 CFloatB = 1.23 CFloatC = 3.21 CComplex64A = 6i + 4 CComplex64B = 6i + 4 CComplex64C = 4i + 6 CComplex128A = 12i + 8 CComplex128B = 12i + 8 CComplex128C = 8i + 12 )
Variables ¶
View Source
var WAW *time.Location
WAW represents Europe/Warsaw timezone.
Functions ¶
Types ¶
type EqualCase ¶
type EqualCase struct {
Desc string // The case description.
Val0 any // The first value.
Val1 any // The second value.
AreEqual bool // Are the values equal?
}
EqualCase represents two values and if they are considered equal.
func EqualConstants ¶
func EqualConstants() []EqualCase
EqualConstants returns cases to test equality for typed constants.
func EqualPrimitives ¶
func EqualPrimitives() []EqualCase
EqualPrimitives returns cases to test equality for primitive types.
type ZENValue ¶
type ZENValue struct {
Desc string // The value description.
Val any // The value.
IsZero bool // Is Val considered zero value.
IsEmpty bool // Is Val considered empty value.
IsNil bool // Is Val considered nil value.
}
ZENValue represents a value and if it's considered zero, empty or nil value.
Click to show internal directories.
Click to hide internal directories.