LGTM, thanks

On Wed, Apr 9, 2014 at 9:06 PM, Klaus Aehlig <[email protected]> wrote:

> Verify that, on the image of extRepr, it holds extRepr . fromExtrRepr = id.
> In other words, verify that when obtain a lock waiting from an extensional
> representation, it has the same extensional representation.
>
> Signed-off-by: Klaus Aehlig <[email protected]>
> ---
>  test/hs/Test/Ganeti/Locking/Waiting.hs | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/test/hs/Test/Ganeti/Locking/Waiting.hs
> b/test/hs/Test/Ganeti/Locking/Waiting.hs
> index ccaf521..26cced3 100644
> --- a/test/hs/Test/Ganeti/Locking/Waiting.hs
> +++ b/test/hs/Test/Ganeti/Locking/Waiting.hs
> @@ -225,6 +225,18 @@ prop_PendingJustified =
>    in printTestCase "Pebding requests must be good and not fulfillable"
>       . all isJustified . S.toList $ getPendingRequests state
>
> +-- | Verify that extRepr . fromExtRepr = id for all valid extensional
> +-- representations.
> +prop_extReprPreserved :: Property
> +prop_extReprPreserved =
> +  forAll (arbitrary :: Gen (LockWaiting TestLock TestOwner Integer)) $
> \state ->
> +  let rep = extRepr state
> +      rep' = extRepr $ fromExtRepr rep
> +  in printTestCase "a lock waiting obtained from an extensional
> representation\
> +                   \ must have the same extensional representation"
> +     $ rep' == rep
> +
> +
>  testSuite "Locking/Waiting"
>   [ 'prop_NoActionWithPendingRequests
>   , 'prop_WaitingRequestsGetPending
> @@ -233,4 +245,5 @@ testSuite "Locking/Waiting"
>   , 'prop_Progress
>   , 'prop_ProgressSound
>   , 'prop_PendingJustified
> + , 'prop_extReprPreserved
>   ]
> --
> 1.9.1.423.g4596e3a
>
>

Reply via email to