Generation of test case data for Scala and Java, in the spirit of QuickCheck. When your test fails, it gives you a minimised failing test case and a way of reproducing the failure immediately.
MIT License
15
stars
1
forks
source link
Trials.reject should be compatible with any type. #68
Trials.reject currently is typed to yield Unit in Scala and void in Java. This means that it can't be used in a value expression, so it tends to end up either in a guard block or is hoisted right up to a catch clause of a try construct that encloses the entire parameterised test.
It would be nice to make it more like Scala's ??? operator, so it can be used anywhere, safe in the knowledge that it always throw an exception and is thus nominally compatible with any expected type.
Not sure what the equivalent in Java would be - maybe define it as a generic method and hope that type inference will be able to unify at its call sites?
Trials.reject
currently is typed to yieldUnit
in Scala andvoid
in Java. This means that it can't be used in a value expression, so it tends to end up either in a guard block or is hoisted right up to a catch clause of a try construct that encloses the entire parameterised test.It would be nice to make it more like Scala's
???
operator, so it can be used anywhere, safe in the knowledge that it always throw an exception and is thus nominally compatible with any expected type.Not sure what the equivalent in Java would be - maybe define it as a generic method and hope that type inference will be able to unify at its call sites?