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

FOXBind does not shrink consistently when nested #33

Open jeffh opened 9 years ago

jeffh commented 9 years ago

FOXBind should prefer shrinking first values. But it seems to shrink more arbitrarily.

Needs more investigation.

Drawing from memory.

id<Generator> generator = FOXBind(FOXInteger(), ^id (id num1){
    return FOXBind(FOXInteger(), ^id (id num2) {
        return @[num1, num2];
    });
});

FOXAssert(FOXForAll(generator, ^BOOL (NSArray *values) {
    return [values[0] integerValue] + [values[1] integerValue] < 10;
});