From ba1260bac492b90688393980b2ec7f48c07e1085 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Thu, 8 Dec 2011 10:39:29 +0100 Subject: [PATCH] Some small test simplifications Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Guido Trotter <ultrotter@google.com> --- htools/Ganeti/HTools/QC.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htools/Ganeti/HTools/QC.hs b/htools/Ganeti/HTools/QC.hs index 022d39436..df1da6b98 100644 --- a/htools/Ganeti/HTools/QC.hs +++ b/htools/Ganeti/HTools/QC.hs @@ -331,9 +331,9 @@ prop_Utils_select :: Int -- ^ Default result -> Gen Prop -- ^ Test result prop_Utils_select def lst1 lst2 = Utils.select def (flist ++ tlist) ==? expectedresult - where expectedresult = Utils.if' (null lst2) def (head lst2) - flist = map (\e -> (False, e)) lst1 - tlist = map (\e -> (True, e)) lst2 + where expectedresult = Utils.if' (null lst2) def (head lst2) + flist = zip (repeat False) lst1 + tlist = zip (repeat True) lst2 -- | Test basic select functionality with undefined default prop_Utils_select_undefd :: [Int] -- ^ List of False values @@ -341,8 +341,8 @@ prop_Utils_select_undefd :: [Int] -- ^ List of False values -> Gen Prop -- ^ Test result prop_Utils_select_undefd lst1 (NonEmpty lst2) = Utils.select undefined (flist ++ tlist) ==? head lst2 - where flist = map (\e -> (False, e)) lst1 - tlist = map (\e -> (True, e)) lst2 + where flist = zip (repeat False) lst1 + tlist = zip (repeat True) lst2 -- | Test basic select functionality with undefined list values prop_Utils_select_undefv :: [Int] -- ^ List of False values @@ -350,9 +350,9 @@ prop_Utils_select_undefv :: [Int] -- ^ List of False values -> Gen Prop -- ^ Test result prop_Utils_select_undefv lst1 (NonEmpty lst2) = Utils.select undefined cndlist ==? head lst2 - where flist = map (\e -> (False, e)) lst1 - tlist = map (\e -> (True, e)) lst2 - cndlist = flist ++ tlist ++ [undefined] + where flist = zip (repeat False) lst1 + tlist = zip (repeat True) lst2 + cndlist = flist ++ tlist ++ [undefined] prop_Utils_parseUnit (NonNegative n) = Utils.parseUnit (show n) == Types.Ok n && -- GitLab