From 15e3d31ca62f10224413f6e89b0349a46a557acb Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Sun, 15 Jan 2012 02:02:22 +0100
Subject: [PATCH] Generate tags using the helper in Node tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Otherwise we test very big lists (slow) without any advantage in doing
so.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenΓ© Nussbaumer <rn@google.com>
---
 htools/Ganeti/HTools/QC.hs | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/htools/Ganeti/HTools/QC.hs b/htools/Ganeti/HTools/QC.hs
index 91a6ad4bc..e2c005974 100644
--- a/htools/Ganeti/HTools/QC.hs
+++ b/htools/Ganeti/HTools/QC.hs
@@ -1033,14 +1033,15 @@ prop_Node_setMdsk node mx =
           SmallRatio mx' = mx
 
 -- Check tag maps
-prop_Node_tagMaps_idempotent tags =
+prop_Node_tagMaps_idempotent =
+  forAll genTags $ \tags ->
   Node.delTags (Node.addTags m tags) tags ==? m
     where m = Data.Map.empty
 
-prop_Node_tagMaps_reject tags =
-  not (null tags) ==>
-  all (\t -> Node.rejectAddTags m [t]) tags
-    where m = Node.addTags Data.Map.empty tags
+prop_Node_tagMaps_reject =
+  forAll (genTags `suchThat` (not . null)) $ \tags ->
+  let m = Node.addTags Data.Map.empty tags
+  in all (\t -> Node.rejectAddTags m [t]) tags
 
 prop_Node_showField node =
   forAll (elements Node.defaultFields) $ \ field ->
-- 
GitLab