github typelift/SwiftCheck v0.3.0
Check Your Privilege

latest releases: 0.12.0, 0.11.0, 0.10.1...
9 years ago

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 an Arbitrary instance. Everybody gets an Arbitrary instance!
  • Those classes and structures that could not be made Arbitrary now have Arbitrary-like extensions for use with forAllShrink.
  • The WitnessedArbitrary protocol has been added for higher-order types like [Arbitrary] and Set<Arbitrary>.
  • The IsoOf modifier has been added. It works like ArrowOf, 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 an Arbitrary 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

Don't miss a new SwiftCheck release

NewReleases is sending notifications on new releases.