You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Two arbFs with same arguments always produce identical functions #314
@RunWith(PropertyTestRunner.class)
public final class ArbFProperties {
public Property arbFProperty() {
return Property.property(
Arbitrary.arbF(Cogen.cogenInteger, Arbitrary.arbInteger),
Arbitrary.arbF(Cogen.cogenInteger, Arbitrary.arbInteger),
Arbitrary.arbInteger,
(f1, f2, arg) -> {
System.out.format("arg = %d, f1(arg) = %d, f2(arg) = %d%n", arg, f1.f(arg), f2.f(arg));
return Property.prop(true);
});
}
}
The functions always produce the same result. This seems to be intentional, the way arbF is programmed, but it is surprising to me. To create two independent functions, I have to use different cogenerators for the arguments (different arbitraries for the results are harder to make independent).
changed the title [-]arbF with same arguments always produces identical functions[/-][+]Two arbFs with same arguments always produce identical functions[/+]on Feb 23, 2017
Activity
[-]arbF with same arguments always produces identical functions[/-][+]Two arbFs with same arguments always produce identical functions[/+]mrbackend commentedon Feb 23, 2017
A workaround that seems to work ok is: