jeffh / Fox

Property Based Testing Library for Objective-C and Swift. QuickCheck for Apple's Platforms.
http://fox-testing.rtfd.org
Other
624 stars 30 forks source link

Can't use FOXAssert from Swift #13

Closed modocache closed 9 years ago

modocache commented 9 years ago

Since FOXAssert is a complex macro, it can't be used in tests written in Swift. The only option is to use the underlying _FOXAssert, which ends up being quite messy:

let _ = _FOXAssert(FOXForAll(FOXInteger(), { integer in
  return integer as Int == 1
}), "should be equal to one", __FILE__, __LINE__, FOXOptions(seed: arc4random(), numberOfTests: 100, maximumSize: 1000))

In the meantime, I'm using a custom Nimble matcher (see #4), but it seems like it'd be a good idea to provide an assertion function Swift consumers can use.

modocache commented 9 years ago

This was pretty much taken care of in 569a86a--thanks a ton! :+1: :100: