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

Passing test takes long time to finish (> 30 sec) #45

Closed niilohlin closed 8 years ago

niilohlin commented 8 years ago

I tried to run the following code using XCode 7 both on a physical device and on a simulated ios device.

id<FOXGenerator> generator = FOXArray(FOXAlphabeticalString());

FOXAssert(FOXForAll(generator, ^BOOL(NSArray<NSString *> *array) {
    return array.count >= 0;
}));

It ran in 38 seconds. Is this expected behaviour? Failing tests finish in < 1 sec.

niilohlin commented 8 years ago

Fixed it by lowering FOXOptions.numberOfTests, maybe the default is set to high?

jeffh commented 8 years ago

String generation hasn't been optimized yet. Collection generation tends to be much slower than atomic values