Documentation
¶
Overview ¶
Package anftest defines a test suite for anf set implementations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RapidSpec ¶
type RapidSpec interface { // RandomElement returns a [rapid] generator that produces a random instance // of your set element type. // // If you cannot generate an appropriate result, return nil. This will // cause the test case to be skipped. RandomElement() *rapid.Generator[any] // SingletonSet returns an [anf.Set] containing only the given element. SingletonSet(element any) anf.Set // RandomSet returns a [rapid] generator that produces a random set. You do // not have to guarantee that the set is empty, even in min is > 0. (With // an ANF set, we can't assume that a set with a non-empty set of clauses is // empty.) // // If you cannot generate an appropriate result, return nil. This will // cause the test case to be skipped. RandomSet(min, max int) *rapid.Generator[anf.Set] // RandomElementOf returns a [rapid] generator that produces a random // element of a particular set. Be careful not to be too aggressive about // using [rapid.Generator.Filter], since if that returns false too often // your tests can fail due to not being able to generate enough valid test // instances. // // If you cannot generate an appropriate result, return nil. This will // cause the test case to be skipped. RandomElementOf(set anf.Set) *rapid.Generator[any] }
RapidSpec provides rapid generators for the elements and sets that you are testing.
Click to show internal directories.
Click to hide internal directories.