Revision ba1260ba htools/Ganeti/HTools/QC.hs
b/htools/Ganeti/HTools/QC.hs | ||
---|---|---|
331 | 331 |
-> Gen Prop -- ^ Test result |
332 | 332 |
prop_Utils_select def lst1 lst2 = |
333 | 333 |
Utils.select def (flist ++ tlist) ==? expectedresult |
334 |
where expectedresult = Utils.if' (null lst2) def (head lst2) |
|
335 |
flist = map (\e -> (False, e)) lst1
|
|
336 |
tlist = map (\e -> (True, e)) lst2
|
|
334 |
where expectedresult = Utils.if' (null lst2) def (head lst2)
|
|
335 |
flist = zip (repeat False) lst1
|
|
336 |
tlist = zip (repeat True) lst2
|
|
337 | 337 |
|
338 | 338 |
-- | Test basic select functionality with undefined default |
339 | 339 |
prop_Utils_select_undefd :: [Int] -- ^ List of False values |
... | ... | |
341 | 341 |
-> Gen Prop -- ^ Test result |
342 | 342 |
prop_Utils_select_undefd lst1 (NonEmpty lst2) = |
343 | 343 |
Utils.select undefined (flist ++ tlist) ==? head lst2 |
344 |
where flist = map (\e -> (False, e)) lst1
|
|
345 |
tlist = map (\e -> (True, e)) lst2
|
|
344 |
where flist = zip (repeat False) lst1
|
|
345 |
tlist = zip (repeat True) lst2
|
|
346 | 346 |
|
347 | 347 |
-- | Test basic select functionality with undefined list values |
348 | 348 |
prop_Utils_select_undefv :: [Int] -- ^ List of False values |
... | ... | |
350 | 350 |
-> Gen Prop -- ^ Test result |
351 | 351 |
prop_Utils_select_undefv lst1 (NonEmpty lst2) = |
352 | 352 |
Utils.select undefined cndlist ==? head lst2 |
353 |
where flist = map (\e -> (False, e)) lst1
|
|
354 |
tlist = map (\e -> (True, e)) lst2
|
|
355 |
cndlist = flist ++ tlist ++ [undefined] |
|
353 |
where flist = zip (repeat False) lst1
|
|
354 |
tlist = zip (repeat True) lst2
|
|
355 |
cndlist = flist ++ tlist ++ [undefined]
|
|
356 | 356 |
|
357 | 357 |
prop_Utils_parseUnit (NonNegative n) = |
358 | 358 |
Utils.parseUnit (show n) == Types.Ok n && |
Also available in: Unified diff