List of notable changes to this project.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.0 - 2019-11-19
samples
property inGenerator
interface. (Samples are about to be included in generation ofgenerate
)- One should use
withSamples
andfrequency
instead.
andThen
operator to make easier building complex generation pipelinefrequency
combinator, allowing to create a frequency-parametrized generator
- Kotlin (from
1.3.50
to1.3.60
)
0.2.0-rc.1 - 2019-09-18
- default max size/length for string,collection and sequence generators set to 50 (instead of 200)
sequences
generatoruuids
generator
0.2.0-beta.2 - 2019-09-16
- Method
Generator.randoms(Long)
the generator should generate single values, not a sequence.
- (Breaking) method
generate(Random): T
in interfaceGenerator
to generate single value. checkForAll
. An alternative toforAll
allowing to use assertion (throw in case of error) instead of returning a boolean. It can be especially helpful to more descriptive message about what is wrong.Generator.randomSequence
extension function to replace the deprecatedGenerator.randoms(Long): Sequence<T>
0.2.0-beta.1 - 2019-09-15
- Wrap exceptions thrown by the properties so that an helpful message can be displayed (number of attempts, arguments, etc.)
- Kotlin (from
1.3.41
to1.3.50
)
0.1.0 - 2019-07-28
StringCharSets
object withnumeric
,alphaLowerCase
,alphaUpperCase
,alpha
andalphaNumeric
.- Sets of character to easily configure the string generator.
kwik.iterations
system property to globally define a default number of iteration.
- Generator API moved to
generator-api
module (artifactsgenerator-api-common
andgenerator-api-jvm
) - Generators for types of the kotlin standard library is moved to generator-stdlib module
(artifacts
generator-stdlib-common
andgenerator-stdlib-jvm
) - The property evaluation is moved to evaluator
(artifacts
evaluator-common
andevaluator-jvm
)
Note
The module core
remains as an alias of all the modules above.
So it is still easy to get started with Kwik by simply adding core
as a dependency
The packages have been renamed, and classes/files have been moved to reflect their new module (see Modules extracted from core)
- (Breaking) The content
com.github.jcornaz.kwik.generator
as been moved tocom.github.jcornaz.kwik.generator.stdlib
- (Breaking) The content
com.github.jcornaz.kwik
as been splitted intocom.github.jcornaz.kwik.generator.api
andcom.github.jcornaz.kwik.evaluator
- Kotlin (from
1.3.40
to1.3.41
)
0.1.0-beta.1 - 2019-07-01
- (Breaking)
PropertyEvaluationContext
available as a type-receiver in property evaluation skipIf
function onPropertyEvaluationContext
allowing to skip a property evaluation for some specific set of input- Few aliases to get common generators:
positiveInts
,naturalInts
,negativeInts
andnonZeroInts
positiveLongs
,naturalLongs
,negativeLongs
andnonZeroLongs
positiveFloats
,negativeFloats
andnonZeroFloats
positiveDoubles
,negativeDoubles
andnonZeroDoubles
nonEmptyStrings
andnonBlankStrings
nonEmptyLists
,nonEmptySets
andnonEmptyMaps
- Show test details in console only in case of success
- Improved exception message in case of falsified property (and introduce typed exception
FalsifiedPropertyError
- Kotlin (from
1.3.31
to1.3.40
)
0.1.0-alpha.4 - 2019-06-10
filter
operator for generators- (Breaking)
samples
property in theGenerator
interface to improve management of the value samples (edge-cases) forAll
non-inline function, allowing to hide implementation details.+
operator for generator, allowing to merge 2 operators. Example:nonZeroInts() = ints(max = -1) + ints(min = 1)
- (Breaking) Renamed arguments
from
anduntil
offloats
anddoubles
generators for more consistency with the int and long generators - (Breaking) Make the lambda of
forAll
crossinline, to allow usage of a non-inline function and hide implementation details. - Now the size probability for strings a collections generators is similar for all sizes. Instead, they have empty and singletons instances as samples
combine
andcombineWith
now start by a combination of the source generators and will randomly add samples in the random generations.- Prevent error when passing a big min size/length without a max size/length for collection and strings generators
- (Breaking)
ratio
argument from thewithSamples
andwithNull
operators
0.1.0-alpha.3 - 2019-06-08
Generator.combine
as a style alternative to combine generators
- (Breaking)
zip
operator renamed tocombineWith
for better clarity and discoverability
0.1.0-alpha.2 - 2019-05-19
ints
,longs
,floats
,doubles
andboolean
generatorsmap
operator to transform an existing generatorGenerator.of()
to create a generator from a finite set of samplesenum
to create a generator from an enumstrings
to create a String generatordefault
Capable of inferring what generator to return for a given typelists
,sets
andmaps
generators
- (Breaking) Default generator arguments added in
forAll
andcheckForAll
- (Breaking)
checkForAll
functions as it was unsafe, allowing to forget assertions without compile-time error
0.1.0-alpha.1 - 2019-05-18
Generator
interface for generating random valuesrandomSequence
helper to easily create a random (yet predictable) sequence of valueforAll
andcheckForAll
function to assess a property of the system under test.withSample
andwithNull
to inject constants values to be always testedzip
operator to combine two given generators