kiri_check
library
Classes
Arbitrary <T >
Components that generate data and perform shrinking,
which are especially crucial elements in property-based testing.
CharacterSet
A set of characters that can be used to match against code points.
This is used to define constraints for generation of string and runes .
Deck
An object generated by deck that can select arbitraries dynamically
to generate values.
KiriCheck
Global test settings.
NominalDateTime
Datetime exactly as numerically represented.
Unlike DateTime
, it does not validate for authenticity,
so it can hold imaginary dates as they are.
Enums
CharacterEncoding
Character encoding types.
EdgeCasePolicy
An enum that represents the policy for generating edge cases.
GenerationPolicy
An enum that represents the policy for generating values.
ShrinkingPolicy
An enum that represents the policy for controlling the number of times
an example is attempted to be shrunk by the shrinker.
This policy dictates how the shrinker operates in terms of attempting to
find simpler failing examples.
Verbosity
The verbosity level for the test progress.
Functions
addTearDownCurrentForAll (FutureOr <void > callback () )
→ void
Registers a function to be run after the current test in forAll
.
binary ({int ? minLength , int ? maxLength })
→ Arbitrary <List <int > >
Returns an arbitrary that generates a binary value.
boolean ()
→ Arbitrary <bool >
Returns an arbitrary that generates a boolean value.
build <T > (T builder () )
→ Arbitrary <T >
Returns an arbitrary that generates a value using the provided builder.
collect (Object value , [Object ? value1 , Object ? value2 , Object ? value3 , Object ? value4 , Object ? value5 , Object ? value6 , Object ? value7 , Object ? value8 ])
→ void
Collects the given test data.
combine2 <E1 , E2 > (Arbitrary <E1 > a1 , Arbitrary <E2 > a2 )
→ Arbitrary <(E1 , E2 ) >
Returns an arbitrary that combines arbitraries.
combine3 <E1 , E2 , E3 > (Arbitrary <E1 > a1 , Arbitrary <E2 > a2 , Arbitrary <E3 > a3 )
→ Arbitrary <(E1 , E2 , E3 ) >
Returns an arbitrary that combines arbitraries.
combine4 <E1 , E2 , E3 , E4 > (Arbitrary <E1 > a1 , Arbitrary <E2 > a2 , Arbitrary <E3 > a3 , Arbitrary <E4 > a4 )
→ Arbitrary <(E1 , E2 , E3 , E4 ) >
Returns an arbitrary that combines arbitraries.
combine5 <E1 , E2 , E3 , E4 , E5 > (Arbitrary <E1 > a1 , Arbitrary <E2 > a2 , Arbitrary <E3 > a3 , Arbitrary <E4 > a4 , Arbitrary <E5 > a5 )
→ Arbitrary <(E1 , E2 , E3 , E4 , E5 ) >
Returns an arbitrary that combines arbitraries.
combine6 <E1 , E2 , E3 , E4 , E5 , E6 > (Arbitrary <E1 > a1 , Arbitrary <E2 > a2 , Arbitrary <E3 > a3 , Arbitrary <E4 > a4 , Arbitrary <E5 > a5 , Arbitrary <E6 > a6 )
→ Arbitrary <(E1 , E2 , E3 , E4 , E5 , E6 ) >
Returns an arbitrary that combines arbitraries.
combine7 <E1 , E2 , E3 , E4 , E5 , E6 , E7 > (Arbitrary <E1 > a1 , Arbitrary <E2 > a2 , Arbitrary <E3 > a3 , Arbitrary <E4 > a4 , Arbitrary <E5 > a5 , Arbitrary <E6 > a6 , Arbitrary <E7 > a7 )
→ Arbitrary <(E1 , E2 , E3 , E4 , E5 , E6 , E7 ) >
Returns an arbitrary that combines arbitraries.
combine8 <E1 , E2 , E3 , E4 , E5 , E6 , E7 , E8 > (Arbitrary <E1 > a1 , Arbitrary <E2 > a2 , Arbitrary <E3 > a3 , Arbitrary <E4 > a4 , Arbitrary <E5 > a5 , Arbitrary <E6 > a6 , Arbitrary <E7 > a7 , Arbitrary <E8 > a8 )
→ Arbitrary <(E1 , E2 , E3 , E4 , E5 , E6 , E7 , E8 ) >
Returns an arbitrary that combines arbitraries.
constant <T > (T value )
→ Arbitrary <T >
Returns an arbitrary that generates a constant value.
constantFrom <T > (List <T > values )
→ Arbitrary <T >
Returns an arbitrary that generates a constant value from a list of values.
dateTime ({DateTime ? min , DateTime ? max , String ? location })
→ Arbitrary <TZDateTime >
Returns an arbitrary that generates a datetime value.
deck ()
→ Arbitrary <Deck >
Returns an arbitrary that generates a deck.
float ({double ? min , double ? max , bool ? minExcluded , bool ? maxExcluded , bool ? nan , bool ? infinity })
→ Arbitrary <double >
Returns an arbitrary that generates a double value.
forAll <T > (Arbitrary <T > arbitrary , FutureOr <void > block (T ), {int ? maxExamples , int ? maxTries , int ? maxShrinkingTries , RandomContext? random , int ? seed , GenerationPolicy ? generationPolicy , ShrinkingPolicy ? shrinkingPolicy , EdgeCasePolicy ? edgeCasePolicy , FutureOr <void > setUp ()?, FutureOr <void > tearDown ()?, FutureOr <void > setUpAll ()?, FutureOr <void > tearDownAll ()?, FutureOr <void > onGenerate (T )?, FutureOr <void > onShrink (T )?, FutureOr <void > onFalsify (T )?, bool ? ignoreFalsify })
→ void
Executes a test for all generated inputs that meet the specified properties,
leveraging an arbitrary to produce a wide range of inputs.
frequency (List <(int , Arbitrary ) > arbitraries )
→ Arbitrary
Returns an arbitrary that generates values based on weighted probabilities.
integer ({int ? min , int ? max })
→ Arbitrary <int >
Returns an arbitrary that generates an integer value.
list <T > (Arbitrary <T > element , {int ? minLength , int ? maxLength , bool ? unique , bool uniqueBy (T , T )? })
→ Arbitrary <List <T > >
Returns an arbitrary that generates a list value.
map <K , V > (Arbitrary <K > key , Arbitrary <V > value , {int ? minLength , int ? maxLength })
→ Arbitrary <Map <K , V > >
Returns an arbitrary that generates a map value.
nominalDateTime ({DateTime ? min , DateTime ? max , String ? location , bool ? imaginary })
→ Arbitrary <NominalDateTime >
Returns an arbitrary that generates a nominal datetime value.
null_ ()
→ Arbitrary <Null >
Returns an arbitrary that generates a null value.
oneOf (List <Arbitrary > arbitraries )
→ Arbitrary
Returns an arbitrary that generates a value from
one of the provided arbitraries.
property (Object ? description , FutureOr <void > body (), {String ? testOn , Timeout? timeout , Object ? skip , Object ? tags , Map <String , dynamic > ? onPlatform })
→ void
Executes a property-based test, acting as a wrapper around the test
function
from the test
package.
recursive <T > (Arbitrary <T > base (), Arbitrary <T > Function() extend (Arbitrary <T > () ), {int ? maxDepth })
→ Arbitrary <T >
Returns an arbitrary that generates values for recursive data structures
using the provided base
and extend
functions.
runes ({int ? minLength , int ? maxLength , CharacterSet ? characterSet })
→ Arbitrary <Runes >
Returns an arbitrary that generates a runes value.
set <T > (Arbitrary <T > element , {int ? minLength , int ? maxLength })
→ Arbitrary <Set <T > >
Returns an arbitrary that generates a set value.
setUpForAll (FutureOr <void > callback () )
→ void
Registers a function to be run before each test in forAll
.
string ({int ? minLength , int ? maxLength , CharacterSet ? characterSet })
→ Arbitrary <String >
Returns an arbitrary that generates a string value.
tearDownForAll (FutureOr <void > callback () )
→ void
Registers a function to be run after each test in forAll
.