Safe Haskell | None |
---|
Unittests for the SlotMap.
Synopsis
- genSlotLimit :: Gen Int
- genSlotCount :: Gen Int
- resampleFittingSlot :: Slot -> Gen Slot
- type TestKey = String
- genTestKey :: Gen TestKey
- listSizeGen :: Gen Int
- genSlotMap :: Ord a => Gen a -> Gen (SlotMap a)
- genCountMap :: Ord a => Gen a -> Gen (CountMap a)
- overfullKeys :: Ord a => SlotMap a -> Set a
- genFittingSlotMap :: Ord a => Gen a -> Gen (SlotMap a)
- case_isOverfull :: Assertion
- case_occupySlots_examples :: Assertion
- keyUnion :: Ord a => Map a b -> Map a c -> Set a
- prop_occupySlots :: Property
- case_hasSlotsFor_examples :: Assertion
- prop_hasSlotsFor_fitting :: Property
- prop_hasSlotsFor :: Property
- testSlotMap :: Test
Documentation
genSlotLimit :: Gen Int Source #
genSlotCount :: Gen Int Source #
resampleFittingSlot :: Slot -> Gen Slot Source #
Takes a slot and resamples its slotOccupied
count to fit the limit.
genTestKey :: Gen TestKey Source #
listSizeGen :: Gen Int Source #
Generates small lists.
genSlotMap :: Ord a => Gen a -> Gen (SlotMap a) Source #
Generates a SlotMap
given a generator for the keys (see genTestKey
).
genCountMap :: Ord a => Gen a -> Gen (CountMap a) Source #
Generates a CountMap
given a generator for the keys (see genTestKey
).
overfullKeys :: Ord a => SlotMap a -> Set a Source #
Tells which keys of a SlotMap
are overfull.
genFittingSlotMap :: Ord a => Gen a -> Gen (SlotMap a) Source #
Generates a SlotMap
for which all slots are within their limits.
Test cases
case_isOverfull :: Assertion Source #
case_occupySlots_examples :: Assertion Source #
prop_occupySlots :: Property Source #
Tests properties of SlotMap
s being filled up.
case_hasSlotsFor_examples :: Assertion Source #
Tests for whether there's still space for a job given its rate limits.
prop_hasSlotsFor_fitting :: Property Source #
Tests properties of hasSlotsFor
on SlotMap
s that are known to
respect their limits.
prop_hasSlotsFor :: Property Source #
Tests properties of hasSlotsFor
, irrespective of whether the
input SlotMap
s respect their limits or not.
testSlotMap :: Test Source #