This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
0.5.0
Breaking
Property1
and all other Property classes got their property
method changed from fun box
to fun ref
. The idea behind i is that you can access and mutate state within your property class now (e.g. increase a counter or whatever).
Added
- We now have classes
Property2
,Property3
andProperty4
if you want to generate multiple values for your property. Example:
class SuccessfulProperty2 is Property2[U8, U8]
fun name(): String => "2-element-property"
fun gen1(): Generator[U8] => Generators.u8(0, 1)
fun gen2(): Generator[U8] => Generators.u8(2, 3)
fun ref property2(arg1: U8, arg2: U8, h: PropertyHelper) =>
h.assert_true((arg1 + arg2) >= arg1)
h.assert_true((arg1 + arg2) >= arg2)
- For cases like above, where you would actually want to test something against all possible integer types we now have:
IntProperty
andIntPairProperty
to have properties that are checked on all int-types. To see them in action, check out: https://github.com/mfelsche/stdlib-properties/blob/master/stdlib-properties/main.pony