QuickCheck 2.7 compatibility
authorNiklas Hambuechen <niklash@google.com>
Fri, 7 Nov 2014 22:48:46 +0000 (23:48 +0100)
committerNiklas Hambuechen <niklash@google.com>
Mon, 10 Nov 2014 10:54:10 +0000 (11:54 +0100)
commit4320ba1dcfe49b659abbc46a6cf37e6a4db66f22
tree2f88c6ac5fb335ebb61a551eea50a1e6f174247f
parent088f1849a63b27823878511bdf779cd8f3b7056e
QuickCheck 2.7 compatibility

This makes our test compile with out errors with QuickCheck 2.7.
Warnings about the deprecation of printTestCase remain when using 2.7.

This change is backwards-compatible with all older versions of QuickCheck
that we support.

In 2.7, Property is no longer a monad, but remains a `Gen Prop` inside,
so that we only have to use combinations of `property` and `return`
to become compatible.

See
  https://hackage.haskell.org/package/QuickCheck-2.7.6/changelog

Further, in QuickCheck 2.7, Positive/NonZero/NonNegative are no longer
instances of `Integral` (NonNegative could likely still be one, see
https://github.com/nick8325/quickcheck/issues/31).
Consequently we cannot create them using `fromIntegral` any more,
and switch to `fromEnum` instead, which also is backwards-compatible.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
test/hs/Test/Ganeti/HTools/Types.hs
test/hs/Test/Ganeti/JQScheduler.hs
test/hs/Test/Ganeti/JQueue.hs
test/hs/Test/Ganeti/JSON.hs
test/hs/Test/Ganeti/Objects/BitArray.hs
test/hs/Test/Ganeti/Storage/Drbd/Types.hs
test/hs/Test/Ganeti/TestCommon.hs
test/hs/Test/Ganeti/Utils.hs