avoid head
authorJoey Hess <joeyh@joeyh.name>
Thu, 26 Sep 2024 21:49:41 +0000 (17:49 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 26 Sep 2024 21:49:41 +0000 (17:49 -0400)
Seems like generate works fine to generate a single arbitrary value, I
dunno why I used sample' originally.

Command/FuzzTest.hs

index 642f07b51df6e2fb757f070834d094ed7bdf56a1..8efbda85934230ea56d6d28c8efcc054093f47ce 100644 (file)
@@ -190,7 +190,7 @@ runFuzzAction (FuzzPause d) = randomDelay d
 
 genFuzzAction :: Annex FuzzAction
 genFuzzAction = do
-       tmpl <- liftIO $ Prelude.head <$> sample' (arbitrary :: Gen FuzzAction)
+       tmpl <- liftIO $ generate (arbitrary :: Gen FuzzAction)
        -- Fix up template action to make sense in the current repo tree.
        case tmpl of
                FuzzAdd _ -> do