LGTM, thanks.
On Thu, Feb 20, 2014 at 5:02 PM, Klaus Aehlig <[email protected]> wrote: > Also allow the newly exported function opportunisticLockUnion in the > construction of arbitrary lock allocations. > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > test/hs/Test/Ganeti/Locking/Allocation.hs | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/test/hs/Test/Ganeti/Locking/Allocation.hs > b/test/hs/Test/Ganeti/Locking/Allocation.hs > index 2cb20ee..257d281 100644 > --- a/test/hs/Test/Ganeti/Locking/Allocation.hs > +++ b/test/hs/Test/Ganeti/Locking/Allocation.hs > @@ -94,6 +94,7 @@ instance Arbitrary a => Arbitrary (LockRequest a) where > > data UpdateRequest b a = UpdateRequest b [LockRequest a] > | IntersectRequest b [a] > + | OpportunisticUnion b [(a, OwnerState)] > | FreeLockRequest b > deriving Show > > @@ -102,6 +103,8 @@ instance (Arbitrary a, Arbitrary b) => Arbitrary > (UpdateRequest a b) where > frequency [ (4, UpdateRequest <$> arbitrary <*> (choose (1, 4) >>= > vector)) > , (2, IntersectRequest <$> arbitrary > <*> (choose (1, 4) >>= vector)) > + , (2, OpportunisticUnion <$> arbitrary > + <*> (choose (1, 4) >>= vector)) > , (1, FreeLockRequest <$> arbitrary) > ] > > @@ -112,6 +115,8 @@ asAllocTrans state (UpdateRequest owner updates) = > fst $ updateLocks owner updates state > asAllocTrans state (IntersectRequest owner locks) = > intersectLocks owner locks state > +asAllocTrans state (OpportunisticUnion owner locks) = > + fst $ opportunisticLockUnion owner locks state > asAllocTrans state (FreeLockRequest owner) = freeLocks state owner > > -- | Fold a sequence of requests to transform a lock allocation onto the > empty > -- > 1.9.0.rc1.175.g0b1dcb5 > >
