Good News Everyone!
SwiftCheck now fully supports Swift 2.0. Other changes include:
- The syntax for testing has changed slightly.
property["Numa Numa"] = forAll { //... }
now becomes
property("Numa Numa") <- forAll { //... }
- We have a shiny new tutorial playground where you can explore SwiftCheck to your heart's content.
- Support for tvOS has been added!
- Handling of signs in signed integer generation has been fixed (h/t @brentleyjones).
- SwiftCheck is now fully integrated with XCTest. Failures will display on the properties and lines that caused them.
- You get an
Arbitrary
instance, and you get anArbitrary
instance. Everybody gets anArbitrary
instance! - Those classes and structures that could not be made
Arbitrary
now haveArbitrary
-like extensions for use withforAllShrink
. - The
WitnessedArbitrary
protocol has been added for higher-order types like[Arbitrary]
andSet<Arbitrary>
. - The
IsoOf
modifier has been added. It works likeArrowOf
, but in 2 directions instead of just 1. - Operators have been split into their own package and standardized across TypeLift.
shrink
is now an optional requirement for anArbitrary
instance. If none is provided, SwiftCheck will assume you don't want to shrink at all.conjamb
, the non-deterministic conjunction combinator, has been added.- The
Large
modifier has been added. It allows integers to be generated in their entire range rather than be bounded by their Generator's size. - Arguments that modify the testing loop can now be passed in a
property
call.
// Re-checks all tests with this generator and size.
let args = CheckerArguments( replay: Optional.Some((newStdGen(), 10))
// Doubles the required number of tests to pass
, maxAllowableSuccessfulTests: 200
// We can no longer discard.
, maxAllowableDiscardedTests: 0
// 10x the default size of the test case.
, maxTestCaseSize: 1000
)
property("Discards forbidden", arguments: args) <- forAll { (x : UInt) in
return Discard()
}.expectFailure