Testing Problem
The setup like this:
@Domain(MyDomain.class)
@Domain(DomainContext.Global.class)
class TestTest {
@Property
boolean test(@ForAll Predicate<Number> p1, @ForAll Predicate<Number> p2, @ForAll Number n) {
return p1.or(p2).test(n) == (p1.test(n) || p2.test(n));
}
}
class MyThing implements Predicate<CharSequence> {
public boolean test(CharSequence cs) { return true; }
}
class MyDomain extends DomainContextBase {
@Provide
Arbitrary<MyThing> myThingArbitrary() {
return Arbitraries.just(new MyThing());
}
}
will produce:
java.lang.ClassCastException:
class java.lang.Long cannot be cast to class java.lang.CharSequence (java.lang.Long and java.lang.CharSequence are in module java.base of loader 'bootstrap')
but if you remove domain and provide MyThing right in test class - no problem.
Testing Problem
The setup like this:
will produce:
but if you remove domain and provide
MyThingright in test class - no problem.