QuickCheck 2.7 compatibility
authorNiklas Hambuechen <niklash@google.com>
Fri, 7 Nov 2014 22:48:46 +0000 (23:48 +0100)
committerPetr Pudlak <pudlak@google.com>
Mon, 22 Jun 2015 16:14:21 +0000 (18:14 +0200)
commitfce815427d0cadb353fb36f63c2810c218f57b4f
tree892dbc277f96a06b8a8001b5a3454922b582deb5
parent21a6f27c11adcfa14dfeb6ddc643406447740f88
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>

Conflicts:
test/hs/Test/Ganeti/JQScheduler.hs - removed file not present in
          2.12

Cherry-picked-from: 4320ba1dcfe49b659abbc46a6cf37e6a4db66f22
Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
test/hs/Test/Ganeti/HTools/Types.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